From patchwork Fri Jul 5 22:43:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 2824419 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 E0DD69F7D6 for ; Fri, 5 Jul 2013 22:44:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E281E20122 for ; Fri, 5 Jul 2013 22:44:27 +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 DBD7F20116 for ; Fri, 5 Jul 2013 22:44:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvEjg-0004eI-6Q; Fri, 05 Jul 2013 22:44:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvEjd-0000SN-Gw; Fri, 05 Jul 2013 22:44:13 +0000 Received: from qmta15.emeryville.ca.mail.comcast.net ([2001:558:fe2d:44:76:96:27:228]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvEja-0000Rp-3d for linux-arm-kernel@lists.infradead.org; Fri, 05 Jul 2013 22:44:11 +0000 Received: from omta05.emeryville.ca.mail.comcast.net ([76.96.30.43]) by qmta15.emeryville.ca.mail.comcast.net with comcast id wmWK1l0020vp7WLAFmjo3S; Fri, 05 Jul 2013 22:43:48 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta05.emeryville.ca.mail.comcast.net with comcast id wmjn1l00M0MU7Qa8Rmjn5N; Fri, 05 Jul 2013 22:43:48 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id 9563380134; Fri, 5 Jul 2013 16:44:00 -0600 (MDT) From: Shuah Khan To: linux@arm.linux.org.uk, gregkh@linuxfoundation.org Subject: [PATCH] arm: Convert scoop platform and bus legacy pm_ops to dev_pm_ops Date: Fri, 5 Jul 2013 16:43:43 -0600 Message-Id: <1373064223-13510-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=1373064228; bh=sWtNmchIul+RHeVHDsZUmHDLv4m4r9uFdQcmtM0Itt0=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=O+y3p9DsLgk9Sr7pIEhCE04R4M4qViA/mOlX7swEDi7KC8zYIFive1wc+TxnfebP0 VVfN+ffiy5L5jAt6+N2mAakRU7HOpsdUZeU8HFcSePXPdvkxOgWQW8BzzwHZQZjnDx 1r+O4k+6QfXtGIgUCU0DVcZcx4edo3j0ZrLz4A5+GH8Ux68Ivdk9MciM2gWqPXw9Me 5rnrreRNQ2uuEREAnkeg+meT6KP05hyl0AohChNZI6iropTyPoxk/vWbpwBWSEF3hK FhAfH36opLiHzQE3y5Qc+KYDw1AV+oEHcpa2K3TLe2dyslUzMM7NVFEG2S7Z0CpxeK f+Jw09ukYmSnA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130705_184410_365453_482203C8 X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. 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/scoop 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/scoop.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index a5c3dc3..8d64fcb 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c @@ -141,7 +141,7 @@ EXPORT_SYMBOL(reset_scoop); EXPORT_SYMBOL(read_scoop_reg); EXPORT_SYMBOL(write_scoop_reg); -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static void check_scoop_reg(struct scoop_dev *sdev) { unsigned short mcr; @@ -151,9 +151,9 @@ static void check_scoop_reg(struct scoop_dev *sdev) iowrite16(0x0101, sdev->base + SCOOP_MCR); } -static int scoop_suspend(struct platform_device *dev, pm_message_t state) +static int scoop_suspend(struct device *dev) { - struct scoop_dev *sdev = platform_get_drvdata(dev); + struct scoop_dev *sdev = platform_get_drvdata(to_platform_device(dev)); check_scoop_reg(sdev); sdev->scoop_gpwr = ioread16(sdev->base + SCOOP_GPWR); @@ -162,18 +162,16 @@ static int scoop_suspend(struct platform_device *dev, pm_message_t state) return 0; } -static int scoop_resume(struct platform_device *dev) +static int scoop_resume(struct device *dev) { - struct scoop_dev *sdev = platform_get_drvdata(dev); + struct scoop_dev *sdev = platform_get_drvdata(to_platform_device(dev)); check_scoop_reg(sdev); iowrite16(sdev->scoop_gpwr, sdev->base + SCOOP_GPWR); return 0; } -#else -#define scoop_suspend NULL -#define scoop_resume NULL +static SIMPLE_DEV_PM_OPS(scoop_dev_pm_ops, scoop_suspend, scoop_resume); #endif static int scoop_probe(struct platform_device *pdev) @@ -269,10 +267,11 @@ static int scoop_remove(struct platform_device *pdev) static struct platform_driver scoop_driver = { .probe = scoop_probe, .remove = scoop_remove, - .suspend = scoop_suspend, - .resume = scoop_resume, .driver = { .name = "sharp-scoop", +#ifdef CONFIG_PM_SLEEP + .pm = &scoop_dev_pm_ops, +#endif }, };