From: Jingoo Han Date: Thu, 29 Nov 2012 03:18:19 +0000 (+1100) Subject: backlight: da903x_bl: use dev_get_drvdata() instead of platform_get_drvdata() X-Git-Tag: next-20121205~1^2~202 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b8909fe87a2ea6f409c00bdf7c609c2b5abab8f6;p=karo-tx-linux.git backlight: da903x_bl: use dev_get_drvdata() instead of platform_get_drvdata() dev_get_drvdata() can be used instead of platform_get_drvdata() to make the code smaller. Signed-off-by: Jingoo Han Cc: Richard Purdie Cc: Mike Rapoport Signed-off-by: Andrew Morton --- diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 573c7ece0fde..6891754143d4 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;