From patchwork Fri May 31 17:08:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 247989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pd0-f189.google.com (mail-pd0-f189.google.com [209.85.192.189]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8073C2C009C for ; Sat, 1 Jun 2013 03:09:14 +1000 (EST) Received: by mail-pd0-f189.google.com with SMTP id r11sf481656pdi.26 for ; Fri, 31 May 2013 10:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:x-beenthere:from:to:cc:subject:date:message-id :x-mailer:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-google-group-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=9tP9D0J3RNMYuOF0aX32pOTHN2vvRtLj5u8IAAVcsoI=; b=h4RFzK+28E41/3r5yMTVJDab4digtWDncGuKnFoKgCIuMjNBmH0W6xZKWOfI/ENTuZ rXdgRalnTYOD1XyLIiZqLW6rfPuPUI64wvm8SbgvL5B/GkJxpFnPhOrqmP9CIJIVFRNT 649AO9h1TP6KuzBdi8I8hAidmNYmgf7lVId1WUobEOxs1vkUXLdWJP1RoxOtJRdWCMqn 527f0Q01hvt8PvKokvK6+IGc73+ai+E4ljJ4I8gLX3dIvZ8dnS23o1tn5pH/YEmvdXLs gsFsneoogcFZvzCIivYEXSEb5EzbXvYOl2Yam1jmDz8PJuwqaO4R5+JxnTZsDpxW/TJ6 HUMg== X-Received: by 10.50.33.37 with SMTP id o5mr604493igi.2.1370020152319; Fri, 31 May 2013 10:09:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.83.103 with SMTP id p7ls702659igy.19.gmail; Fri, 31 May 2013 10:09:11 -0700 (PDT) X-Received: by 10.66.117.172 with SMTP id kf12mr2458953pab.31.1370020151834; Fri, 31 May 2013 10:09:11 -0700 (PDT) Received: from qmta12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net. [2001:558:fe2d:44:76:96:27:227]) by gmr-mx.google.com with ESMTP id sr2si1029611pbc.2.2013.05.31.10.09.11 for ; Fri, 31 May 2013 10:09:11 -0700 (PDT) Received-SPF: neutral (google.com: 2001:558:fe2d:44:76:96:27:227 is neither permitted nor denied by best guess record for domain of shuah.kh@samsung.com) client-ip=2001:558:fe2d:44:76:96:27:227; Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta12.emeryville.ca.mail.comcast.net with comcast id ig3W1l0071zF43Q01h9BDR; Fri, 31 May 2013 17:09:11 +0000 Received: from mail.gonehiking.org ([75.71.126.5]) by omta24.emeryville.ca.mail.comcast.net with comcast id ih991l00f076gX78kh99PE; Fri, 31 May 2013 17:09:11 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id 751BE80019; Fri, 31 May 2013 11:09:13 -0600 (MDT) From: Shuah Khan To: a.zummo@towertech.it, rafael.j.wysocki@intel.com Cc: Shuah Khan , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, shuahkhan@gmail.com Subject: [rtc-linux] [PATCH v2] drivers/rtc/class: Convert from Legacy pm ops to dev_pm_ops Date: Fri, 31 May 2013 11:08:42 -0600 Message-Id: <1370020122-29869-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-Original-Sender: shuah.kh@samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:558:fe2d:44:76:96:27:227 is neither permitted nor denied by best guess record for domain of shuah.kh@samsung.com) smtp.mail=shuah.kh@samsung.com; dkim=pass (test mode) header.i=@comcast.net Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Convert drivers/rtc/class to use dev_pm_ops for power management and remove Legacy PM ops hooks. With this change, rtc class registers suspend/resume callbacks via class->pm (dev_pm_ops) instead of Legacy class->suspend/resume. When __device_suspend() runs call-backs, it will find class->pm ops for the rtc class. Signed-off-by: Shuah Khan Cc: Shuah Khan --- drivers/rtc/class.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 6638540..f379bff 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -47,7 +47,7 @@ int rtc_hctosys_ret = -ENODEV; static struct timespec old_rtc, old_system, old_delta; -static int rtc_suspend(struct device *dev, pm_message_t mesg) +static int rtc_suspend(struct device *dev) { struct rtc_device *rtc = to_rtc_device(dev); struct rtc_time tm; @@ -135,9 +135,9 @@ static int rtc_resume(struct device *dev) return 0; } +static SIMPLE_DEV_PM_OPS(rtc_class_dev_pm_ops, rtc_suspend, rtc_resume); #else -#define rtc_suspend NULL -#define rtc_resume NULL +#define rtc_class_dev_pm_ops NULL #endif @@ -336,8 +336,7 @@ static int __init rtc_init(void) pr_err("couldn't create class\n"); return PTR_ERR(rtc_class); } - rtc_class->suspend = rtc_suspend; - rtc_class->resume = rtc_resume; + rtc_class->pm = &rtc_class_dev_pm_ops; rtc_dev_init(); rtc_sysfs_init(rtc_class); return 0;