From patchwork Fri Jul 5 22:41:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 2824417 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6C7E89F7D6 for ; Fri, 5 Jul 2013 22:42:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 817CD20160 for ; Fri, 5 Jul 2013 22:42:13 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 76E602015D for ; Fri, 5 Jul 2013 22:42:12 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvEhI-0003nC-Ut; Fri, 05 Jul 2013 22:41:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvEh7-0000Qp-La; Fri, 05 Jul 2013 22:41:37 +0000 Received: from qmta13.emeryville.ca.mail.comcast.net ([2001:558:fe2d:44:76:96:27:243]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvEh4-0000QL-Pj for linux-arm-kernel@lists.infradead.org; Fri, 05 Jul 2013 22:41:36 +0000 Received: from omta10.emeryville.ca.mail.comcast.net ([76.96.30.28]) by qmta13.emeryville.ca.mail.comcast.net with comcast id wm4q1l0010cQ2SLADmhAFf; Fri, 05 Jul 2013 22:41:10 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta10.emeryville.ca.mail.comcast.net with comcast id wmh81l00W0MU7Qa8Wmh9Ps; Fri, 05 Jul 2013 22:41:10 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id 9AF7180134; Fri, 5 Jul 2013 16:41:21 -0600 (MDT) From: Shuah Khan To: linux@arm.linux.org.uk Subject: [PATCH] arm: Convert locomo platform and bus legacy pm_ops to dev_pm_ops Date: Fri, 5 Jul 2013 16:41:03 -0600 Message-Id: <1373064063-13473-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.7.10.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1373064070; bh=K2GZbO6J4KMSMm/xn+/QFjAfYiEVkYzBzyq7cex2YQA=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=GGrUtgfRGNrpsEigQlZabmPSxtaObPwgdBNCoNJP/exvv/3HcHM1iVsprup4INd05 DRQWS+W9Z6OFfKTPCB/Zd+r/9ULi80hWSgOMowPXl3VILGMDpuBEdmAlCb5AbckrOp aONHPRyWyQv3XWrSqLDHQcjJs3w9y5KBzPsd46ydejEvR7Mb4fEtH/gRY8Wx7/lwUu Nj2RhQ7s0mwkPZw2YhbYYukUXjMVMsPtWvCiYTMP5su+VtwvGlKV+rNh92/TbdqUP3 GC8qPHl2yzQJ10/eRJJ6MCC5nv39oWUbQNbca6/cl18p/erbgJTPLqkxO95WZ+ApfT +NEWzG7N+v2UA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130705_184135_042486_AC63FCAF X-CRM114-Status: GOOD ( 10.58 ) X-Spam-Score: -1.9 (-) Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, shuahkhan@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert arch/arm/common/locomo platform and bus legacy pm_ops to dev_pm_ops. This change also updates the use of COMFIG_PM to CONFIG_PM_SLEEP as this platform and bus code implements PM_SLEEP ops and not the PM_RUNTIME ops. Compile tested. Signed-off-by: Shuah Khan --- arch/arm/common/locomo.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index b55c362..4028e41 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -262,7 +262,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info) return ret; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP struct locomo_save_data { u16 LCM_GPO; @@ -272,9 +272,9 @@ struct locomo_save_data { u16 LCM_SPIMD; }; -static int locomo_suspend(struct platform_device *dev, pm_message_t state) +static int locomo_suspend(struct device *dev) { - struct locomo *lchip = platform_get_drvdata(dev); + struct locomo *lchip = platform_get_drvdata(to_platform_device(dev)); struct locomo_save_data *save; unsigned long flags; @@ -316,9 +316,9 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state) return 0; } -static int locomo_resume(struct platform_device *dev) +static int locomo_resume(struct device *dev) { - struct locomo *lchip = platform_get_drvdata(dev); + struct locomo *lchip = platform_get_drvdata(to_platform_device(dev)); struct locomo_save_data *save; unsigned long r; unsigned long flags; @@ -351,6 +351,8 @@ static int locomo_resume(struct platform_device *dev) return 0; } + +static SIMPLE_DEV_PM_OPS(locomo_dev_pm_ops, locomo_suspend, locomo_resume); #endif @@ -519,12 +521,11 @@ static int locomo_remove(struct platform_device *dev) static struct platform_driver locomo_device_driver = { .probe = locomo_probe, .remove = locomo_remove, -#ifdef CONFIG_PM - .suspend = locomo_suspend, - .resume = locomo_resume, -#endif .driver = { .name = "locomo", +#ifdef CONFIG_PM_SLEEP + .pm = &locomo_dev_pm_ops, +#endif }, }; @@ -826,14 +827,15 @@ static int locomo_match(struct device *_dev, struct device_driver *_drv) return dev->devid == drv->devid; } -static int locomo_bus_suspend(struct device *dev, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int locomo_bus_suspend(struct device *dev) { struct locomo_dev *ldev = LOCOMO_DEV(dev); struct locomo_driver *drv = LOCOMO_DRV(dev->driver); int ret = 0; if (drv && drv->suspend) - ret = drv->suspend(ldev, state); + ret = drv->suspend(ldev, PMSG_SUSPEND); return ret; } @@ -848,6 +850,10 @@ static int locomo_bus_resume(struct device *dev) return ret; } +static SIMPLE_DEV_PM_OPS(locomo_bus_dev_pm_ops, locomo_bus_suspend, + locomo_bus_resume); +#endif + static int locomo_bus_probe(struct device *dev) { struct locomo_dev *ldev = LOCOMO_DEV(dev); @@ -875,8 +881,9 @@ struct bus_type locomo_bus_type = { .match = locomo_match, .probe = locomo_bus_probe, .remove = locomo_bus_remove, - .suspend = locomo_bus_suspend, - .resume = locomo_bus_resume, +#ifdef CONFIG_PM_SLEEP + .pm = &locomo_bus_dev_pm_ops, +#endif }; int locomo_driver_register(struct locomo_driver *driver)