From patchwork Sun Dec 16 04:21:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 10732365 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 E9D0817E1 for ; Sun, 16 Dec 2018 05:19:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9FE3298BE for ; Sun, 16 Dec 2018 05:19:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB00729BD8; Sun, 16 Dec 2018 05:19:42 +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 8564E298BE for ; Sun, 16 Dec 2018 05:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729623AbeLPFTf (ORCPT ); Sun, 16 Dec 2018 00:19:35 -0500 Received: from fallback21.m.smailru.net ([94.100.176.131]:60780 "EHLO fallback21.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729069AbeLPFTf (ORCPT ); Sun, 16 Dec 2018 00:19:35 -0500 X-Greylist: delayed 3488 seconds by postgrey-1.27 at vger.kernel.org; Sun, 16 Dec 2018 00:19:33 EST 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=mnCNtmVhseOW8hBxr0y61XME5hAtUchCFmEzT0iCuJc=; b=PCSjVCrP5+qoapU8f1spF8Jzta48/R1IkXzo4p4hOqcUubxd64zg6O0phNJRfvau0CvhVzQnbdwiyvqrCTDVB/uIaZAlmne99A0QHeH+hkLgypr4Zk13qbB8OOgNJtpIv8vxZnwq4x4QNJPAlMaeQSBc6ldpnYzPeuCdBd5ZKyY=; Received: from [10.161.22.24] (port=48938 helo=smtp54.i.mail.ru) by fallback21.m.smailru.net with esmtp (envelope-from ) id 1gYNvg-0001WX-3B; Sun, 16 Dec 2018 07:21:24 +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=mnCNtmVhseOW8hBxr0y61XME5hAtUchCFmEzT0iCuJc=; b=PCSjVCrP5+qoapU8f1spF8Jzta48/R1IkXzo4p4hOqcUubxd64zg6O0phNJRfvau0CvhVzQnbdwiyvqrCTDVB/uIaZAlmne99A0QHeH+hkLgypr4Zk13qbB8OOgNJtpIv8vxZnwq4x4QNJPAlMaeQSBc6ldpnYzPeuCdBd5ZKyY=; Received: by smtp54.i.mail.ru with esmtpa (envelope-from ) id 1gYNva-0005fi-UH; Sun, 16 Dec 2018 07:21:19 +0300 From: Alexander Shiyan To: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, linux-pwm@vger.kernel.org, Thierry Reding , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Alexander Shiyan Subject: [PATCH] backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS() Date: Sun, 16 Dec 2018 07:21:12 +0300 Message-Id: <20181216042112.22644-1-shc_work@mail.ru> X-Mailer: git-send-email 2.10.2 X-77F55803: 6115F4D8777AF1675A78504BD2AC294197136A761B282385510C095B1037008C85BB15192B1B01E3581231206FE4F22C X-7FA49CB5: 0D63561A33F958A5C2A9B36F093C1529AD0D5B74C04420C1743A183F80FB961A8941B15DA834481FA18204E546F3947C0A9EC8C3488E7643F6B57BC7E64490618DEB871D839B7333395957E7521B51C2545D4CF71C94A83E9FA2833FD35BB23D27C277FBC8AE2E8B8883BAB8B32E402CA471835C12D1D977C4224003CC8364767815B9869FA544D8D32BA5DBAC0009BE9E8FC8737B5C2249E20791DD86E535D73AA81AA40904B5D9CF19DD082D7633A0E7DDDDC251EA7DABD81D268191BDAD3D78DA827A17800CE74AAC223A686B1DECB3661434B16C20ACE7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7CC7ACE15776152C0260EE13F4120B93DFEFF80C71ABB335746BA297DBC24807EA27F269C8F02392CD20465B3A5AADEC6827F269C8F02392CD5571747095F342E88FB05168BE4CE3AF X-Mailru-Sender: 139A7956A63CACCF2A18077BC60D24455D5DB112C59BD77F5D9A700C520027D77B99AE584D2C8A136B3B2BD4812BFD4DC77752E0C033A69E93554C27080790AB3B25A7FBAAF806F0AE208404248635DF X-Mras: OK X-77F55803: E8DB3678F13EF3E07F9F52485CB584D7271FD7DF62800FDCAE1E1E8EA8F3500A0C234A797274C17CC5F670149289142B914B5F6CBB272511 X-7FA49CB5: 0D63561A33F958A512EAB84C6F7EA468E48099A1ABA1125AE95ECE4F6ADB247E8941B15DA834481FA18204E546F3947C17119E5299B287EEF6B57BC7E64490618DEB871D839B7333395957E7521B51C2545D4CF71C94A83E9FA2833FD35BB23D27C277FBC8AE2E8BC908CD1B87A134A2A471835C12D1D977C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-Mailru-Sender: A5480F10D64C90054EBC784E05B2229070FA2CF402F4D9B00C234A797274C17C84876E3DC5E244DF3786569BE0651809D50E20E2BC48EF5AFF3C6AF3E48A3A73EAB4BC95F72C04283CDA0F3B3F5B9367 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 | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index f9ef067..33503ce 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -667,8 +667,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_bl_suspend(struct device *dev) { struct backlight_device *bl = dev_get_drvdata(dev); struct pwm_bl_data *pb = bl_get_data(bl); @@ -684,7 +683,7 @@ static int pwm_backlight_suspend(struct device *dev) return 0; } -static int pwm_backlight_resume(struct device *dev) +static int __maybe_unused pwm_bl_resume(struct device *dev) { struct backlight_device *bl = dev_get_drvdata(dev); @@ -692,21 +691,13 @@ 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_bl_pm_ops, pwm_bl_suspend, pwm_bl_resume); static struct platform_driver pwm_backlight_driver = { .driver = { .name = "pwm-backlight", - .pm = &pwm_backlight_pm_ops, + .pm = &pwm_bl_pm_ops, .of_match_table = of_match_ptr(pwm_backlight_of_match), }, .probe = pwm_backlight_probe,