From patchwork Sat Mar 9 18:09:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 226353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ia0-x23d.google.com (mail-ia0-x23d.google.com [IPv6:2607:f8b0:4001:c02::23d]) (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 391FE2C0344 for ; Sun, 10 Mar 2013 05:12:26 +1100 (EST) Received: by mail-ia0-f189.google.com with SMTP id t4sf1058338iag.16 for ; Sat, 09 Mar 2013 10:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:x-beenthere:x-received:received-spf:x-pgp-universal:from :to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version: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=GmcLYWSmyY9jC4XYNI81SM1r5o64O0dXSCO9kctzlY8=; b=xnvk2FfAbKf4FHtr+FyCsxrnikVeDbEiq7FKd0eAI+O79M6I58Q379UxlRrCFLXanz zs8tm/CeTaKUe0dzCAkIuOxKEyLE88+/qJ07mgPjc4E872fJxS/g8kcb3oQUGp+BTbBW sVq3vHyOyd8JjBb3vaW+YwWRo7Z0I94dSCbC7dVCbeJz/arVHEmtfP805U6yKouFu4/S +9NA+mwFeuTtQce+2UTLlKrlX5RGh6Lq7oAO0qxNmnTrDKiNaFzDHAZ3hfq7E4zAEI6k 6+H4/ft4YOMqY2PLi4BR2FCLR410C9eO6bNNNlVlPjrtqCt8kKgqmRJgnUUYhI2iT8z1 usAw== X-Received: by 10.50.186.133 with SMTP id fk5mr364991igc.0.1362852744625; Sat, 09 Mar 2013 10:12:24 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.209.1 with SMTP id mi1ls410082igc.30.canary; Sat, 09 Mar 2013 10:12:24 -0800 (PST) X-Received: by 10.68.132.73 with SMTP id os9mr3271850pbb.4.1362852744028; Sat, 09 Mar 2013 10:12:24 -0800 (PST) Received: from hqemgate03.nvidia.com (hqemgate03.nvidia.com. [216.228.121.140]) by gmr-mx.google.com with ESMTPS id ir9si2872269pbc.1.2013.03.09.10.12.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 09 Mar 2013 10:12:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.140 as permitted sender) client-ip=216.228.121.140; Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Sat, 09 Mar 2013 10:16:56 -0800 Received: from hqemhub03.nvidia.com ([172.17.108.22]) by hqnvupgp07.nvidia.com (PGP Universal service); Sat, 09 Mar 2013 10:11:47 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Sat, 09 Mar 2013 10:11:47 -0800 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQEMHUB03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.298.1; Sat, 9 Mar 2013 10:11:47 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw02.nvidia.com with MailMarshal (v7,1,2,5326) id ; Sat, 09 Mar 2013 10:11:47 -0800 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id r29IBcU6026785; Sat, 9 Mar 2013 10:11:45 -0800 (PST) From: Laxman Dewangan To: , CC: , , , , Laxman Dewangan Subject: [rtc-linux] [PATCH 2/5] rtc: tegra: Use struct dev_pm_ops for power management Date: Sat, 9 Mar 2013 23:39:46 +0530 Message-ID: <1362852588-13362-3-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <1362852588-13362-1-git-send-email-ldewangan@nvidia.com> References: <1362852588-13362-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 X-Original-Sender: ldewangan@nvidia.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.140 as permitted sender) smtp.mail=ldewangan@nvidia.com 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: , Make the Tegra RTC controller driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver. Signed-off-by: Laxman Dewangan --- drivers/rtc/rtc-tegra.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index d64cde6..f7718de 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c @@ -391,10 +391,9 @@ static int __exit tegra_rtc_remove(struct platform_device *pdev) } #ifdef CONFIG_PM_SLEEP -static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state) +static int tegra_rtc_suspend(struct device *dev) { - struct device *dev = &pdev->dev; - struct tegra_rtc_info *info = platform_get_drvdata(pdev); + struct tegra_rtc_info *info = dev_get_drvdata(dev); tegra_rtc_wait_while_busy(dev); @@ -416,10 +415,9 @@ static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -static int tegra_rtc_resume(struct platform_device *pdev) +static int tegra_rtc_resume(struct device *dev) { - struct device *dev = &pdev->dev; - struct tegra_rtc_info *info = platform_get_drvdata(pdev); + struct tegra_rtc_info *info = dev_get_drvdata(dev); dev_vdbg(dev, "Resume (device_may_wakeup=%d)\n", device_may_wakeup(dev)); @@ -431,6 +429,10 @@ static int tegra_rtc_resume(struct platform_device *pdev) } #endif +static const struct dev_pm_ops tegra_rtc_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(tegra_rtc_suspend, tegra_rtc_resume) +}; + static void tegra_rtc_shutdown(struct platform_device *pdev) { dev_vdbg(&pdev->dev, "disabling interrupts.\n"); @@ -445,11 +447,8 @@ static struct platform_driver tegra_rtc_driver = { .name = "tegra_rtc", .owner = THIS_MODULE, .of_match_table = tegra_rtc_dt_match, + .pm = &tegra_rtc_pm_ops, }, -#ifdef CONFIG_PM_SLEEP - .suspend = tegra_rtc_suspend, - .resume = tegra_rtc_resume, -#endif }; static int __init tegra_rtc_init(void)