From patchwork Sat Mar 29 10:11:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 3908241 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36108BF540 for ; Sat, 29 Mar 2014 10:13:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A8B420351 for ; Sat, 29 Mar 2014 10:13:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED94A2034E for ; Sat, 29 Mar 2014 10:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751280AbaC2KN4 (ORCPT ); Sat, 29 Mar 2014 06:13:56 -0400 Received: from fallback4.mail.ru ([94.100.176.42]:55999 "EHLO fallback4.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269AbaC2KN4 (ORCPT ); Sat, 29 Mar 2014 06:13:56 -0400 Received: from smtp26.mail.ru (smtp26.mail.ru [94.100.176.179]) by fallback4.mail.ru (mPOP.Fallback_MX) with ESMTP id 8356B85905D for ; Sat, 29 Mar 2014 14:13:51 +0400 (MSK) 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=YErwUcyV/qVHjXEiYie1HnU6Iqrfv9JCbMLm6SXdDHc=; b=bDw92br2/XT1BQ1IakUiHDzwdIHF38XU5k726NrfeU7Way1y+x53PYhZusElhvCA2ElfY8eMtJOCVBPEzyCFcfucXyPQfYK/H5clpYNF/zLPLi8xJI3kQad7bVih5opoZ8YbPKAd/8t1lThOWcQZRiZr7k9I0enrY1MVYfsnRt0=; Received: from [5.18.98.0] (port=47921 helo=shc.zet) by smtp26.mail.ru with esmtpa (envelope-from ) id 1WTqES-0005jK-2x; Sat, 29 Mar 2014 14:11:20 +0400 From: Alexander Shiyan To: linux-fbdev@vger.kernel.org Cc: Jingoo Han , Bryan Wu , Lee Jones , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Alexander Shiyan Subject: [PATCH] backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS() Date: Sat, 29 Mar 2014 14:11:11 +0400 Message-Id: <1396087871-9091-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.3.2 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Mras: Ok Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RDNS_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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 Use the SIMPLE_DEV_PM_OPS() macro to declare the driver's pm_ops. 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 b75201f..d5e1f5b 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -359,8 +359,7 @@ static int pwm_backlight_remove(struct platform_device *pdev) return 0; } -#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); @@ -376,7 +375,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); @@ -384,22 +383,14 @@ 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", .owner = THIS_MODULE, - .pm = &pwm_backlight_pm_ops, + .pm = &pwm_bl_pm_ops, .of_match_table = of_match_ptr(pwm_backlight_of_match), }, .probe = pwm_backlight_probe,