Commit e6e3dbf9 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

pwm_backlight: use bl_get_data instead of dev_get_drvdata

Use the wrapper function for getting the driver data using
backlight_device instead of using dev_get_drvdata with &bd->dev, so we can
directly pass a struct backlight_device.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 76cb2598
...@@ -37,7 +37,7 @@ struct pwm_bl_data { ...@@ -37,7 +37,7 @@ struct pwm_bl_data {
static int pwm_backlight_update_status(struct backlight_device *bl) static int pwm_backlight_update_status(struct backlight_device *bl)
{ {
struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); struct pwm_bl_data *pb = bl_get_data(bl);
int brightness = bl->props.brightness; int brightness = bl->props.brightness;
int max = bl->props.max_brightness; int max = bl->props.max_brightness;
...@@ -83,7 +83,7 @@ static int pwm_backlight_get_brightness(struct backlight_device *bl) ...@@ -83,7 +83,7 @@ static int pwm_backlight_get_brightness(struct backlight_device *bl)
static int pwm_backlight_check_fb(struct backlight_device *bl, static int pwm_backlight_check_fb(struct backlight_device *bl,
struct fb_info *info) struct fb_info *info)
{ {
struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); struct pwm_bl_data *pb = bl_get_data(bl);
return !pb->check_fb || pb->check_fb(pb->dev, info); return !pb->check_fb || pb->check_fb(pb->dev, info);
} }
...@@ -264,7 +264,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) ...@@ -264,7 +264,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
static int pwm_backlight_remove(struct platform_device *pdev) static int pwm_backlight_remove(struct platform_device *pdev)
{ {
struct backlight_device *bl = platform_get_drvdata(pdev); struct backlight_device *bl = platform_get_drvdata(pdev);
struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); struct pwm_bl_data *pb = bl_get_data(bl);
backlight_device_unregister(bl); backlight_device_unregister(bl);
pwm_config(pb->pwm, 0, pb->period); pwm_config(pb->pwm, 0, pb->period);
...@@ -278,7 +278,7 @@ static int pwm_backlight_remove(struct platform_device *pdev) ...@@ -278,7 +278,7 @@ static int pwm_backlight_remove(struct platform_device *pdev)
static int pwm_backlight_suspend(struct device *dev) static int pwm_backlight_suspend(struct device *dev)
{ {
struct backlight_device *bl = dev_get_drvdata(dev); struct backlight_device *bl = dev_get_drvdata(dev);
struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); struct pwm_bl_data *pb = bl_get_data(bl);
if (pb->notify) if (pb->notify)
pb->notify(pb->dev, 0); pb->notify(pb->dev, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment