|
|
@@ -253,8 +253,6 @@ static const struct drm_panel_funcs sharp_nt_panel_funcs = {
|
|
|
static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
|
|
|
{
|
|
|
struct device *dev = &sharp_nt->dsi->dev;
|
|
|
- struct device_node *np;
|
|
|
- int ret;
|
|
|
|
|
|
sharp_nt->mode = &default_mode;
|
|
|
|
|
|
@@ -271,39 +269,22 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
|
|
|
gpiod_set_value(sharp_nt->reset_gpio, 0);
|
|
|
}
|
|
|
|
|
|
- np = of_parse_phandle(dev->of_node, "backlight", 0);
|
|
|
- if (np) {
|
|
|
- sharp_nt->backlight = of_find_backlight_by_node(np);
|
|
|
- of_node_put(np);
|
|
|
+ sharp_nt->backlight = devm_of_find_backlight(dev);
|
|
|
|
|
|
- if (!sharp_nt->backlight)
|
|
|
- return -EPROBE_DEFER;
|
|
|
- }
|
|
|
+ if (IS_ERR(sharp_nt->backlight))
|
|
|
+ return PTR_ERR(sharp_nt->backlight);
|
|
|
|
|
|
drm_panel_init(&sharp_nt->base);
|
|
|
sharp_nt->base.funcs = &sharp_nt_panel_funcs;
|
|
|
sharp_nt->base.dev = &sharp_nt->dsi->dev;
|
|
|
|
|
|
- ret = drm_panel_add(&sharp_nt->base);
|
|
|
- if (ret < 0)
|
|
|
- goto put_backlight;
|
|
|
-
|
|
|
- return 0;
|
|
|
-
|
|
|
-put_backlight:
|
|
|
- if (sharp_nt->backlight)
|
|
|
- put_device(&sharp_nt->backlight->dev);
|
|
|
-
|
|
|
- return ret;
|
|
|
+ return drm_panel_add(&sharp_nt->base);
|
|
|
}
|
|
|
|
|
|
static void sharp_nt_panel_del(struct sharp_nt_panel *sharp_nt)
|
|
|
{
|
|
|
if (sharp_nt->base.dev)
|
|
|
drm_panel_remove(&sharp_nt->base);
|
|
|
-
|
|
|
- if (sharp_nt->backlight)
|
|
|
- put_device(&sharp_nt->backlight->dev);
|
|
|
}
|
|
|
|
|
|
static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi)
|