From: Alexander Shiyan <shc_work@mail.ru>
To: linux-pwm@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org, Alexander Shiyan <shc_work@mail.ru>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Jingoo Han <jingoohan1@gmail.com>,
Daniel Thompson <daniel.thompson@linaro.org>,
dri-devel@lists.freedesktop.org,
Thierry Reding <thierry.reding@gmail.com>,
Lee Jones <lee.jones@linaro.org>
Subject: [PATCH v2] backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS()
Date: Wed, 16 Jan 2019 13:38:17 +0000 [thread overview]
Message-ID: <20190116133817.2483-1-shc_work@mail.ru> (raw)
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 <shc_work@mail.ru>
---
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 = {
--
2.10.2
next reply other threads:[~2019-01-16 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 13:38 Alexander Shiyan [this message]
2019-01-17 16:14 ` [PATCH v2] backlight: pwm_bl: Use SIMPLE_DEV_PM_OPS() Daniel Thompson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190116133817.2483-1-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=b.zolnierkie@samsung.com \
--cc=daniel.thompson@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).