From patchwork Wed Jan 16 13:38:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 10765981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEB0D91E for ; Wed, 16 Jan 2019 13:38:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F4412D542 for ; Wed, 16 Jan 2019 13:38:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DA0B2DEB8; Wed, 16 Jan 2019 13:38:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 151EC2D542 for ; Wed, 16 Jan 2019 13:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390542AbfAPNig (ORCPT ); Wed, 16 Jan 2019 08:38:36 -0500 Received: from fallback21.m.smailru.net ([94.100.176.131]:54392 "EHLO fallback21.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730657AbfAPNig (ORCPT ); Wed, 16 Jan 2019 08:38:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=PSoW0Kf8q8/U9tZOi6iPc7K4A5jbNjxAK4syAzcRsBs=; b=aUk7sBu+6p3h2m8i1s6kR4UrrzUlBjeqUN/sLDMzU6kSyUzFdNWxoJG5cSryk5bB90WX2O0mqmQnHZ2PFXp+2Wveu3OUsxIzG9CnaGZdS3g70nmpYk4/qQVo/CpXEtOo3W/w1cpxZu1xV67Dq6jVJT4/hmNn+Ff71UGrGloD4YM=; Received: from [10.161.64.56] (port=35266 helo=smtp48.i.mail.ru) by fallback21.m.smailru.net with esmtp (envelope-from ) id 1gjlOr-0002jz-DL; Wed, 16 Jan 2019 16:38:33 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=PSoW0Kf8q8/U9tZOi6iPc7K4A5jbNjxAK4syAzcRsBs=; b=aUk7sBu+6p3h2m8i1s6kR4UrrzUlBjeqUN/sLDMzU6kSyUzFdNWxoJG5cSryk5bB90WX2O0mqmQnHZ2PFXp+2Wveu3OUsxIzG9CnaGZdS3g70nmpYk4/qQVo/CpXEtOo3W/w1cpxZu1xV67Dq6jVJT4/hmNn+Ff71UGrGloD4YM=; Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1gjlOn-0007B2-BZ; Wed, 16 Jan 2019 16:38:29 +0300 From: Alexander Shiyan To: linux-pwm@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Thierry Reding , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Alexander Shiyan Subject: [PATCH v2] backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS() Date: Wed, 16 Jan 2019 16:38:17 +0300 Message-Id: <20190116133817.2483-1-shc_work@mail.ru> X-Mailer: git-send-email 2.10.2 X-77F55803: 3FFC80838138E3AB5A78504BD2AC2941382F125FEC086B48F9B7194DD55147EB6012E62D62A6E8F03FD3ADD9369E6A25 X-7FA49CB5: 0D63561A33F958A52020246BE3542BD03BF2B568B34F1C7EDF860E547B4E4B718941B15DA834481FA18204E546F3947C5B63D382EEF4D896F6B57BC7E64490618DEB871D839B7333395957E7521B51C2545D4CF71C94A83E9FA2833FD35BB23D27C277FBC8AE2E8B587F3D2152687E5CA471835C12D1D977C4224003CC8364767815B9869FA544D8D32BA5DBAC0009BE9E8FC8737B5C2249166FC1BB2721D293D81D268191BDAD3DBD4B6F7A4D31EC0B7815B9869FA544D8090A508E0FED62991661749BA6B97735302FCEF25BFAB345C4224003CC836476C0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E73534E00CCAD257FC1C6847429975395BB2731C566533BA786A40A5AABA2AD371193C9F3DD0FB1AF5EBDFC194086D65061027F269C8F02392CD5571747095F342E88FB05168BE4CE3AF X-Mailru-Sender: 139A7956A63CACCF2A18077BC60D244510ADEC1B9D9B51815E96847EDBC666E584BD7A5DCED5921D6B3B2BD4812BFD4DC77752E0C033A69E93554C27080790AB3B25A7FBAAF806F0AE208404248635DF X-Mras: OK X-77F55803: 6AF0DA0BABFA9FDB7F9F52485CB584D7271FD7DF62800FDCC0F4EBB4EAD42E5B7054686CE329F24F2C591BDC734B4B9E6D8D80A8A8AA787F X-7FA49CB5: 0D63561A33F958A5CA10A12B23F665CE6119DF36EA9016445B5C06708AA48D258941B15DA834481FA18204E546F3947C2D01283D1ACF37BAF6B57BC7E64490618DEB871D839B7333395957E7521B51C2545D4CF71C94A83E9FA2833FD35BB23D27C277FBC8AE2E8B9FC99A4BA45EE8B4A471835C12D1D977C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F8DB212830C5B42F72623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-Mailru-Sender: A5480F10D64C90057D89EA641BAE1DDB04B7498BC259A6DF7054686CE329F24F825871508D9F39703786569BE0651809D50E20E2BC48EF5AFF3C6AF3E48A3A73EAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: OK Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the SIMPLE_DEV_PM_OPS() macro to declare the driver's pm_ops. As a side effect, removing #ifdef CONFIG_PM_SLEEP will improve compilation coverage. Signed-off-by: Alexander Shiyan --- drivers/video/backlight/pwm_bl.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index feb9076..eaefdb0 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -673,8 +673,7 @@ static void pwm_backlight_shutdown(struct platform_device *pdev) pwm_backlight_power_off(pb); } -#ifdef CONFIG_PM_SLEEP -static int pwm_backlight_suspend(struct device *dev) +static int __maybe_unused pwm_backlight_suspend(struct device *dev) { struct backlight_device *bl = dev_get_drvdata(dev); struct pwm_bl_data *pb = bl_get_data(bl); @@ -690,7 +689,7 @@ static int pwm_backlight_suspend(struct device *dev) return 0; } -static int pwm_backlight_resume(struct device *dev) +static int __maybe_unused pwm_backlight_resume(struct device *dev) { struct backlight_device *bl = dev_get_drvdata(dev); @@ -698,16 +697,9 @@ static int pwm_backlight_resume(struct device *dev) return 0; } -#endif -static const struct dev_pm_ops pwm_backlight_pm_ops = { -#ifdef CONFIG_PM_SLEEP - .suspend = pwm_backlight_suspend, - .resume = pwm_backlight_resume, - .poweroff = pwm_backlight_suspend, - .restore = pwm_backlight_resume, -#endif -}; +static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, + pwm_backlight_suspend, pwm_backlight_resume); static struct platform_driver pwm_backlight_driver = { .driver = {