From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>
Cc: "'LKML'" <linux-kernel@vger.kernel.org>,
"'Richard Purdie'" <rpurdie@rpsys.net>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH 09/14] backlight: hp680_bl: convert hp680bl to dev_pm_ops
Date: Tue, 12 Mar 2013 14:52:00 +0900 [thread overview]
Message-ID: <004601ce1ee5$b7145470$253cfd50$%han@samsung.com> (raw)
In-Reply-To: <003e01ce1ee5$4897e020$d9c7a060$%han@samsung.com>
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/backlight/hp680_bl.c | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c
index 5cefd73..00076ec 100644
--- a/drivers/video/backlight/hp680_bl.c
+++ b/drivers/video/backlight/hp680_bl.c
@@ -64,29 +64,28 @@ static void hp680bl_send_intensity(struct backlight_device *bd)
}
-#ifdef CONFIG_PM
-static int hp680bl_suspend(struct platform_device *pdev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int hp680bl_suspend(struct device *dev)
{
- struct backlight_device *bd = platform_get_drvdata(pdev);
+ struct backlight_device *bd = dev_get_drvdata(dev);
hp680bl_suspended = 1;
hp680bl_send_intensity(bd);
return 0;
}
-static int hp680bl_resume(struct platform_device *pdev)
+static int hp680bl_resume(struct device *dev)
{
- struct backlight_device *bd = platform_get_drvdata(pdev);
+ struct backlight_device *bd = dev_get_drvdata(dev);
hp680bl_suspended = 0;
hp680bl_send_intensity(bd);
return 0;
}
-#else
-#define hp680bl_suspend NULL
-#define hp680bl_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(hp680bl_pm_ops, hp680bl_suspend, hp680bl_resume);
+
static int hp680bl_set_intensity(struct backlight_device *bd)
{
hp680bl_send_intensity(bd);
@@ -140,10 +139,9 @@ static int hp680bl_remove(struct platform_device *pdev)
static struct platform_driver hp680bl_driver = {
.probe = hp680bl_probe,
.remove = hp680bl_remove,
- .suspend = hp680bl_suspend,
- .resume = hp680bl_resume,
.driver = {
.name = "hp680-bl",
+ .pm = &hp680bl_pm_ops,
},
};
--
1.7.2.5
next prev parent reply other threads:[~2013-03-12 5:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 5:48 [PATCH 01/14] backlight: ld9040: convert ld9040 " Jingoo Han
2013-03-12 5:49 ` [PATCH 02/14] backlight: lms501kf03: convert lms501kf03 " Jingoo Han
2013-03-12 5:49 ` [PATCH 03/14] backlight: s6e63m0: convert s6e63m0 " Jingoo Han
2013-03-12 5:50 ` [PATCH 04/14] backlight: adp5520: convert adp5520_bl " Jingoo Han
2013-03-12 5:50 ` [PATCH 05/14] backlight: adp8860: convert adp8860 " Jingoo Han
2013-03-12 5:50 ` [PATCH 06/14] backlight: adp8870: convert adp8870 " Jingoo Han
2013-03-12 5:51 ` [PATCH 07/14] backlight: corgi_lcd: convert corgi_lcd " Jingoo Han
2013-03-12 5:51 ` [PATCH 08/14] backlight: ep93xx: convert ep93xx " Jingoo Han
2013-03-12 5:52 ` Jingoo Han [this message]
2013-03-12 5:52 ` [PATCH 10/14] backlight: kb3886_bl: convert kb3886bl " Jingoo Han
2013-03-12 5:52 ` [PATCH 11/14] backlight: lm3533_bl: convert lm3533_bl " Jingoo Han
2013-03-12 5:53 ` [PATCH 12/14] backlight: locomolcd: convert locomolcd " Jingoo Han
2013-03-12 5:53 ` [PATCH 13/14] backlight: ltv350qv: convert ltv350qv " Jingoo Han
2013-03-12 5:53 ` [PATCH 14/14] backlight: tdo24m: convert tdo24m " Jingoo Han
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='004601ce1ee5$b7145470$253cfd50$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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
all inboxes | Powered by JetHome®