mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] backlight: da903x_bl: use dev_get_drvdata() instead of platform_get_drvdata()
@ 2012-10-16  7:24 Jingoo Han
  0 siblings, 0 replies; only message in thread
From: Jingoo Han @ 2012-10-16  7:24 UTC (permalink / raw)
  To: 'Andrew Morton', 'LKML'
  Cc: 'Richard Purdie', 'Mike Rapoport', 'Jingoo Han'

dev_get_drvdata() can be used instead of platform_get_drvdata()
to make the code smaller.
 
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Mike Rapoport <mike@compulab.co.il>
---
 drivers/video/backlight/da903x_bl.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c
index 573c7ec..6891754 100644
--- a/drivers/video/backlight/da903x_bl.c
+++ b/drivers/video/backlight/da903x_bl.c
@@ -164,15 +164,14 @@ static int da903x_backlight_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int da903x_backlight_suspend(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct backlight_device *bl = platform_get_drvdata(pdev);
+	struct backlight_device *bl = dev_get_drvdata(dev);
+
 	return da903x_backlight_set(bl, 0);
 }
 
 static int da903x_backlight_resume(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct backlight_device *bl = platform_get_drvdata(pdev);
+	struct backlight_device *bl = dev_get_drvdata(dev);
 
 	backlight_update_status(bl);
 	return 0;
-- 
1.7.1



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-10-16  7:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-16  7:24 [PATCH] backlight: da903x_bl: use dev_get_drvdata() instead of platform_get_drvdata() Jingoo Han

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®