From 1670b7044d89d62a6a382e528387c44b46c44c11 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Wed, 20 Feb 2013 13:15:25 +1100 Subject: [PATCH] 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: Jingoo Han Cc: Thierry Reding Signed-off-by: Andrew Morton --- drivers/video/backlight/pwm_bl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index a71ef4a79ec4..fa00304a63d8 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -37,7 +37,7 @@ struct pwm_bl_data { 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 max = bl->props.max_brightness; @@ -82,7 +82,7 @@ static int pwm_backlight_get_brightness(struct backlight_device *bl) static int pwm_backlight_check_fb(struct backlight_device *bl, 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); } @@ -264,7 +264,7 @@ err_alloc: static int pwm_backlight_remove(struct platform_device *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); pwm_config(pb->pwm, 0, pb->period); @@ -278,7 +278,7 @@ static int pwm_backlight_remove(struct platform_device *pdev) static int pwm_backlight_suspend(struct device *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) pb->notify(pb->dev, 0); -- 2.39.5