From patchwork Tue Dec 16 16:49:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 27526 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Y0vXx-0005oo-Pk; Tue, 16 Dec 2014 18:04:29 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-8) with esmtp id 1Y0vXv-0005Fq-jS; Tue, 16 Dec 2014 18:04:29 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751504AbaLPREZ (ORCPT + 1 other); Tue, 16 Dec 2014 12:04:25 -0500 Received: from mail-bn1bon0134.outbound.protection.outlook.com ([157.56.111.134]:14710 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750873AbaLPREY (ORCPT ); Tue, 16 Dec 2014 12:04:24 -0500 Received: from BY2PR03CA009.namprd03.prod.outlook.com (10.255.93.26) by BN1PR03MB251.namprd03.prod.outlook.com (10.255.200.18) with Microsoft SMTP Server (TLS) id 15.1.31.17; Tue, 16 Dec 2014 16:49:24 +0000 Received: from BN1BFFO11FD028.protection.gbl (10.255.93.4) by BY2PR03CA009.outlook.office365.com (10.255.93.26) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Tue, 16 Dec 2014 16:49:22 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD028.mail.protection.outlook.com (10.58.144.91) with Microsoft SMTP Server (TLS) id 15.1.26.17 via Frontend Transport; Tue, 16 Dec 2014 16:49:20 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.64]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id sBGGnF97028079; Tue, 16 Dec 2014 09:49:16 -0700 From: Fabio Estevam To: CC: , , Fabio Estevam Subject: [PATCH 1/2] [media] adv7180: Simplify PM hooks Date: Tue, 16 Dec 2014 14:49:06 -0200 Message-ID: <1418748547-12308-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Fabio.Estevam@freescale.com; X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(120916001)(19580395003)(105606002)(46102003)(69596002)(62966003)(68736005)(229853001)(77096005)(99396003)(36756003)(106466001)(21056001)(107046002)(31966008)(50466002)(81156004)(2351001)(77156002)(110136001)(104016003)(33646002)(97736003)(89996001)(47776003)(86362001)(92566001)(50226001)(4396001)(20776003)(6806004)(50986999)(87936001)(19580405001)(85426001)(48376002)(64706001)(84676001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR03MB251; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB251; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:BN1PR03MB251; X-Forefront-PRVS: 04270EF89C X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BN1PR03MB251; X-OriginatorOrg: freescale.com Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.12.16.165419 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' The macro SIMPLE_DEV_PM_OPS already takes care of the CONFIG_PM_SLEEP=n case, so move it out of the CONFIG_PM_SLEEP 'if' block and remove the unneeded ADV7180_PM_OPS definition to make the code simpler. Signed-off-by: Fabio Estevam --- drivers/media/i2c/adv7180.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index bffe6eb..0c1268a 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -700,13 +700,8 @@ static int adv7180_resume(struct device *dev) return ret; return 0; } - -static SIMPLE_DEV_PM_OPS(adv7180_pm_ops, adv7180_suspend, adv7180_resume); -#define ADV7180_PM_OPS (&adv7180_pm_ops) - -#else -#define ADV7180_PM_OPS NULL #endif +static SIMPLE_DEV_PM_OPS(adv7180_pm_ops, adv7180_suspend, adv7180_resume); MODULE_DEVICE_TABLE(i2c, adv7180_id); @@ -714,7 +709,7 @@ static struct i2c_driver adv7180_driver = { .driver = { .owner = THIS_MODULE, .name = KBUILD_MODNAME, - .pm = ADV7180_PM_OPS, + .pm = &adv7180_pm_ops, }, .probe = adv7180_probe, .remove = adv7180_remove,