summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/amba-clcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbdev/amba-clcd.c')
-rw-r--r--drivers/video/fbdev/amba-clcd.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index c3d55fc6c4e0..b7682de412d8 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -602,20 +602,17 @@ static int clcdfb_snprintf_mode(char *buf, int size, struct fb_videomode *mode)
mode->refresh);
}
-static int clcdfb_of_get_backlight(struct device_node *panel,
+static int clcdfb_of_get_backlight(struct device *dev,
struct clcd_panel *clcd_panel)
{
- struct device_node *backlight;
+ struct backlight_device *backlight;
- /* Look up the optional backlight phandle */
- backlight = of_parse_phandle(panel, "backlight", 0);
- if (backlight) {
- clcd_panel->backlight = of_find_backlight_by_node(backlight);
- of_node_put(backlight);
+ /* Look up the optional backlight device */
+ backlight = devm_of_find_backlight(dev);
+ if (IS_ERR(backlight))
+ return PTR_ERR(backlight);
- if (!clcd_panel->backlight)
- return -EPROBE_DEFER;
- }
+ clcd_panel->backlight = backlight;
return 0;
}
@@ -717,7 +714,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
if (!panel)
return -ENODEV;
- err = clcdfb_of_get_backlight(panel, fb->panel);
+ err = clcdfb_of_get_backlight(&fb->dev->dev, fb->panel);
if (err)
return err;