Commit c3ee8c65 authored by Bernard Zhao's avatar Bernard Zhao Committed by Sam Ravnborg

drm/panel: remove return value of function drm_panel_add

The function "int drm_panel_add(struct drm_panel *panel)"
always returns 0, this return value is meaningless.
Also, there is no need to check return value which calls
"drm_panel_add and", error branch code will never run.
Signed-off-by: default avatarBernard Zhao <bernard@vivo.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200801120216.8488-1-bernard@vivo.com
parent 1a3fb590
...@@ -70,16 +70,12 @@ EXPORT_SYMBOL(drm_panel_init); ...@@ -70,16 +70,12 @@ EXPORT_SYMBOL(drm_panel_init);
* *
* Add a panel to the global registry so that it can be looked up by display * Add a panel to the global registry so that it can be looked up by display
* drivers. * drivers.
*
* Return: 0 on success or a negative error code on failure.
*/ */
int drm_panel_add(struct drm_panel *panel) void drm_panel_add(struct drm_panel *panel)
{ {
mutex_lock(&panel_lock); mutex_lock(&panel_lock);
list_add_tail(&panel->list, &panel_list); list_add_tail(&panel->list, &panel_list);
mutex_unlock(&panel_lock); mutex_unlock(&panel_lock);
return 0;
} }
EXPORT_SYMBOL(drm_panel_add); EXPORT_SYMBOL(drm_panel_add);
......
...@@ -349,7 +349,9 @@ static int versatile_panel_probe(struct platform_device *pdev) ...@@ -349,7 +349,9 @@ static int versatile_panel_probe(struct platform_device *pdev)
drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs, drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&vpanel->panel); drm_panel_add(&vpanel->panel);
return 0;
} }
static const struct of_device_id versatile_panel_match[] = { static const struct of_device_id versatile_panel_match[] = {
......
...@@ -315,11 +315,7 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi) ...@@ -315,11 +315,7 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)
return ret; return ret;
} }
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0) {
dev_err(dev, "Failed to add panel: %d\n", ret);
return ret;
}
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) { if (ret < 0) {
......
...@@ -895,7 +895,9 @@ static int panel_add(struct panel_info *pinfo) ...@@ -895,7 +895,9 @@ static int panel_add(struct panel_info *pinfo)
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&pinfo->base); drm_panel_add(&pinfo->base);
return 0;
} }
static int panel_probe(struct mipi_dsi_device *dsi) static int panel_probe(struct mipi_dsi_device *dsi)
......
...@@ -787,7 +787,9 @@ static int boe_panel_add(struct boe_panel *boe) ...@@ -787,7 +787,9 @@ static int boe_panel_add(struct boe_panel *boe)
boe->base.funcs = &boe_panel_funcs; boe->base.funcs = &boe_panel_funcs;
boe->base.dev = &boe->dsi->dev; boe->base.dev = &boe->dsi->dev;
return drm_panel_add(&boe->base); drm_panel_add(&boe->base);
return 0;
} }
static int boe_panel_probe(struct mipi_dsi_device *dsi) static int boe_panel_probe(struct mipi_dsi_device *dsi)
......
...@@ -477,9 +477,7 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -477,9 +477,7 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO; dsi->mode_flags = MIPI_DSI_MODE_VIDEO;
dsi->format = MIPI_DSI_FMT_RGB888; dsi->format = MIPI_DSI_FMT_RGB888;
......
...@@ -224,9 +224,7 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -224,9 +224,7 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST; dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST;
dsi->format = MIPI_DSI_FMT_RGB888; dsi->format = MIPI_DSI_FMT_RGB888;
......
...@@ -892,7 +892,9 @@ static int ili9322_probe(struct spi_device *spi) ...@@ -892,7 +892,9 @@ static int ili9322_probe(struct spi_device *spi)
drm_panel_init(&ili->panel, dev, &ili9322_drm_funcs, drm_panel_init(&ili->panel, dev, &ili9322_drm_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&ili->panel); drm_panel_add(&ili->panel);
return 0;
} }
static int ili9322_remove(struct spi_device *spi) static int ili9322_remove(struct spi_device *spi)
......
...@@ -446,9 +446,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -446,9 +446,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE; dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
dsi->format = MIPI_DSI_FMT_RGB888; dsi->format = MIPI_DSI_FMT_RGB888;
......
...@@ -475,9 +475,7 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi, ...@@ -475,9 +475,7 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi,
if (err) if (err)
return err; return err;
err = drm_panel_add(&innolux->base); drm_panel_add(&innolux->base);
if (err < 0)
return err;
mipi_dsi_set_drvdata(dsi, innolux); mipi_dsi_set_drvdata(dsi, innolux);
innolux->link = dsi; innolux->link = dsi;
......
...@@ -440,9 +440,9 @@ static int jdi_panel_add(struct jdi_panel *jdi) ...@@ -440,9 +440,9 @@ static int jdi_panel_add(struct jdi_panel *jdi)
drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs, drm_panel_init(&jdi->base, &jdi->dsi->dev, &jdi_panel_funcs,
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&jdi->base); drm_panel_add(&jdi->base);
return ret; return 0;
} }
static void jdi_panel_del(struct jdi_panel *jdi) static void jdi_panel_del(struct jdi_panel *jdi)
......
...@@ -382,7 +382,9 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay) ...@@ -382,7 +382,9 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay)
if (err) if (err)
return err; return err;
return drm_panel_add(&kingdisplay->base); drm_panel_add(&kingdisplay->base);
return 0;
} }
static void kingdisplay_panel_del(struct kingdisplay_panel *kingdisplay) static void kingdisplay_panel_del(struct kingdisplay_panel *kingdisplay)
......
...@@ -198,7 +198,9 @@ static int lb035q02_probe(struct spi_device *spi) ...@@ -198,7 +198,9 @@ static int lb035q02_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &lb035q02_funcs, drm_panel_init(&lcd->panel, &lcd->spi->dev, &lb035q02_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
return 0;
} }
static int lb035q02_remove(struct spi_device *spi) static int lb035q02_remove(struct spi_device *spi)
......
...@@ -261,7 +261,9 @@ static int lg4573_probe(struct spi_device *spi) ...@@ -261,7 +261,9 @@ static int lg4573_probe(struct spi_device *spi)
drm_panel_init(&ctx->panel, &spi->dev, &lg4573_drm_funcs, drm_panel_init(&ctx->panel, &spi->dev, &lg4573_drm_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
return 0;
} }
static int lg4573_remove(struct spi_device *spi) static int lg4573_remove(struct spi_device *spi)
......
...@@ -227,9 +227,7 @@ static int panel_lvds_probe(struct platform_device *pdev) ...@@ -227,9 +227,7 @@ static int panel_lvds_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&lvds->panel); drm_panel_add(&lvds->panel);
if (ret < 0)
return ret;
dev_set_drvdata(lvds->dev, lvds); dev_set_drvdata(lvds->dev, lvds);
return 0; return 0;
......
...@@ -207,7 +207,9 @@ static int nl8048_probe(struct spi_device *spi) ...@@ -207,7 +207,9 @@ static int nl8048_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &nl8048_funcs, drm_panel_init(&lcd->panel, &lcd->spi->dev, &nl8048_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
return 0;
} }
static int nl8048_remove(struct spi_device *spi) static int nl8048_remove(struct spi_device *spi)
......
...@@ -956,9 +956,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi) ...@@ -956,9 +956,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
nt->panel.backlight = bl; nt->panel.backlight = bl;
} }
ret = drm_panel_add(&nt->panel); drm_panel_add(&nt->panel);
if (ret < 0)
return ret;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) if (ret < 0)
......
...@@ -303,11 +303,7 @@ static int nt39016_probe(struct spi_device *spi) ...@@ -303,11 +303,7 @@ static int nt39016_probe(struct spi_device *spi)
drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs, drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
err = drm_panel_add(&panel->drm_panel); drm_panel_add(&panel->drm_panel);
if (err < 0) {
dev_err(dev, "Failed to register panel");
return err;
}
return 0; return 0;
} }
......
...@@ -283,7 +283,9 @@ static int lcd_olinuxino_probe(struct i2c_client *client, ...@@ -283,7 +283,9 @@ static int lcd_olinuxino_probe(struct i2c_client *client,
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
return 0;
} }
static int lcd_olinuxino_remove(struct i2c_client *client) static int lcd_olinuxino_remove(struct i2c_client *client)
......
...@@ -164,7 +164,9 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587) ...@@ -164,7 +164,9 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&osd101t2587->base); drm_panel_add(&osd101t2587->base);
return 0;
} }
static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi) static int osd101t2587_panel_probe(struct mipi_dsi_device *dsi)
......
...@@ -206,7 +206,9 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt) ...@@ -206,7 +206,9 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt)
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&wuxga_nt->base); drm_panel_add(&wuxga_nt->base);
return 0;
} }
static void wuxga_nt_panel_del(struct wuxga_nt_panel *wuxga_nt) static void wuxga_nt_panel_del(struct wuxga_nt_panel *wuxga_nt)
......
...@@ -361,7 +361,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c, ...@@ -361,7 +361,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c,
struct rpi_touchscreen *ts; struct rpi_touchscreen *ts;
struct device_node *endpoint, *dsi_host_node; struct device_node *endpoint, *dsi_host_node;
struct mipi_dsi_host *host; struct mipi_dsi_host *host;
int ret, ver; int ver;
struct mipi_dsi_device_info info = { struct mipi_dsi_device_info info = {
.type = RPI_DSI_DRIVER_NAME, .type = RPI_DSI_DRIVER_NAME,
.channel = 0, .channel = 0,
...@@ -429,9 +429,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c, ...@@ -429,9 +429,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c,
/* This appears last, as it's what will unblock the DSI host /* This appears last, as it's what will unblock the DSI host
* driver's component bind function. * driver's component bind function.
*/ */
ret = drm_panel_add(&ts->base); drm_panel_add(&ts->base);
if (ret)
return ret;
return 0; return 0;
......
...@@ -609,9 +609,7 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi) ...@@ -609,9 +609,7 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi)
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
dev_set_drvdata(dev, panel); dev_set_drvdata(dev, panel);
ret = drm_panel_add(&panel->panel); drm_panel_add(&panel->panel);
if (ret)
return ret;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret) if (ret)
......
...@@ -200,9 +200,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -200,9 +200,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM; dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM;
dsi->format = MIPI_DSI_FMT_RGB888; dsi->format = MIPI_DSI_FMT_RGB888;
......
...@@ -354,7 +354,9 @@ static int ld9040_probe(struct spi_device *spi) ...@@ -354,7 +354,9 @@ static int ld9040_probe(struct spi_device *spi)
drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs, drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
return 0;
} }
static int ld9040_remove(struct spi_device *spi) static int ld9040_remove(struct spi_device *spi)
......
...@@ -212,9 +212,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi) ...@@ -212,9 +212,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&s6->panel, dev, &s6d16d0_drm_funcs, drm_panel_init(&s6->panel, dev, &s6d16d0_drm_funcs,
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&s6->panel); drm_panel_add(&s6->panel);
if (ret < 0)
return ret;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) if (ret < 0)
......
...@@ -733,9 +733,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) ...@@ -733,9 +733,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs, drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs,
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
goto unregister_backlight;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) if (ret < 0)
...@@ -745,8 +743,6 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) ...@@ -745,8 +743,6 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
remove_panel: remove_panel:
drm_panel_remove(&ctx->panel); drm_panel_remove(&ctx->panel);
unregister_backlight:
backlight_device_unregister(ctx->bl_dev); backlight_device_unregister(ctx->bl_dev);
return ret; return ret;
......
...@@ -479,9 +479,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi) ...@@ -479,9 +479,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
ctx->bl_dev->props.brightness = DEFAULT_BRIGHTNESS; ctx->bl_dev->props.brightness = DEFAULT_BRIGHTNESS;
ctx->bl_dev->props.power = FB_BLANK_POWERDOWN; ctx->bl_dev->props.power = FB_BLANK_POWERDOWN;
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
goto unregister_backlight;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) if (ret < 0)
...@@ -491,8 +489,6 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi) ...@@ -491,8 +489,6 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
remove_panel: remove_panel:
drm_panel_remove(&ctx->panel); drm_panel_remove(&ctx->panel);
unregister_backlight:
backlight_device_unregister(ctx->bl_dev); backlight_device_unregister(ctx->bl_dev);
return ret; return ret;
......
...@@ -479,7 +479,9 @@ static int s6e63m0_probe(struct spi_device *spi) ...@@ -479,7 +479,9 @@ static int s6e63m0_probe(struct spi_device *spi)
if (ret < 0) if (ret < 0)
return ret; return ret;
return drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
return 0;
} }
static int s6e63m0_remove(struct spi_device *spi) static int s6e63m0_remove(struct spi_device *spi)
......
...@@ -242,11 +242,7 @@ static int s6e88a0_ams452ef01_probe(struct mipi_dsi_device *dsi) ...@@ -242,11 +242,7 @@ static int s6e88a0_ams452ef01_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&ctx->panel, dev, &s6e88a0_ams452ef01_panel_funcs, drm_panel_init(&ctx->panel, dev, &s6e88a0_ams452ef01_panel_funcs,
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0) {
dev_err(dev, "Failed to add panel: %d\n", ret);
return ret;
}
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) { if (ret < 0) {
......
...@@ -1020,9 +1020,7 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi) ...@@ -1020,9 +1020,7 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs, drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs,
DRM_MODE_CONNECTOR_DSI); DRM_MODE_CONNECTOR_DSI);
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) if (ret < 0)
......
...@@ -258,9 +258,7 @@ static int seiko_panel_probe(struct device *dev, ...@@ -258,9 +258,7 @@ static int seiko_panel_probe(struct device *dev,
if (err) if (err)
return err; return err;
err = drm_panel_add(&panel->base); drm_panel_add(&panel->base);
if (err < 0)
return err;
dev_set_drvdata(dev, panel); dev_set_drvdata(dev, panel);
......
...@@ -325,7 +325,9 @@ static int sharp_panel_add(struct sharp_panel *sharp) ...@@ -325,7 +325,9 @@ static int sharp_panel_add(struct sharp_panel *sharp)
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&sharp->base); drm_panel_add(&sharp->base);
return 0;
} }
static void sharp_panel_del(struct sharp_panel *sharp) static void sharp_panel_del(struct sharp_panel *sharp)
......
...@@ -187,7 +187,9 @@ static int ls037v7dw01_probe(struct platform_device *pdev) ...@@ -187,7 +187,9 @@ static int ls037v7dw01_probe(struct platform_device *pdev)
drm_panel_init(&lcd->panel, &pdev->dev, &ls037v7dw01_funcs, drm_panel_init(&lcd->panel, &pdev->dev, &ls037v7dw01_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
return drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
return 0;
} }
static int ls037v7dw01_remove(struct platform_device *pdev) static int ls037v7dw01_remove(struct platform_device *pdev)
......
...@@ -261,7 +261,9 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt) ...@@ -261,7 +261,9 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&sharp_nt->base); drm_panel_add(&sharp_nt->base);
return 0;
} }
static void sharp_nt_panel_del(struct sharp_nt_panel *sharp_nt) static void sharp_nt_panel_del(struct sharp_nt_panel *sharp_nt)
......
...@@ -613,9 +613,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ...@@ -613,9 +613,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
if (err) if (err)
goto free_ddc; goto free_ddc;
err = drm_panel_add(&panel->base); drm_panel_add(&panel->base);
if (err < 0)
goto free_ddc;
dev_set_drvdata(dev, panel); dev_set_drvdata(dev, panel);
......
...@@ -380,9 +380,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -380,9 +380,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&st7701->panel); drm_panel_add(&st7701->panel);
if (ret < 0)
return ret;
mipi_dsi_set_drvdata(dsi, st7701); mipi_dsi_set_drvdata(dsi, st7701);
st7701->dsi = dsi; st7701->dsi = dsi;
......
...@@ -382,9 +382,7 @@ static int st7789v_probe(struct spi_device *spi) ...@@ -382,9 +382,7 @@ static int st7789v_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
ret = drm_panel_add(&ctx->panel); drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
return 0; return 0;
} }
......
...@@ -504,9 +504,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi) ...@@ -504,9 +504,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi)
acx->bl->props.brightness = 512; acx->bl->props.brightness = 512;
acx->bl->props.power = FB_BLANK_POWERDOWN; acx->bl->props.power = FB_BLANK_POWERDOWN;
ret = drm_panel_add(&acx->panel); drm_panel_add(&acx->panel);
if (ret < 0)
return ret;
ret = mipi_dsi_attach(dsi); ret = mipi_dsi_attach(dsi);
if (ret < 0) { if (ret < 0) {
......
...@@ -650,12 +650,7 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -650,12 +650,7 @@ static int acx565akm_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &acx565akm_funcs, drm_panel_init(&lcd->panel, &lcd->spi->dev, &acx565akm_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
ret = drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
if (ret < 0) {
if (lcd->has_bc)
acx565akm_backlight_cleanup(lcd);
return ret;
}
return 0; return 0;
} }
......
...@@ -350,7 +350,9 @@ static int td028ttec1_probe(struct spi_device *spi) ...@@ -350,7 +350,9 @@ static int td028ttec1_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
return drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
return 0;
} }
static int td028ttec1_remove(struct spi_device *spi) static int td028ttec1_remove(struct spi_device *spi)
......
...@@ -460,11 +460,7 @@ static int td043mtea1_probe(struct spi_device *spi) ...@@ -460,11 +460,7 @@ static int td043mtea1_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &td043mtea1_funcs, drm_panel_init(&lcd->panel, &lcd->spi->dev, &td043mtea1_funcs,
DRM_MODE_CONNECTOR_DPI); DRM_MODE_CONNECTOR_DPI);
ret = drm_panel_add(&lcd->panel); drm_panel_add(&lcd->panel);
if (ret < 0) {
sysfs_remove_group(&spi->dev.kobj, &td043mtea1_attr_group);
return ret;
}
return 0; return 0;
} }
......
...@@ -448,7 +448,9 @@ static int tpg110_probe(struct spi_device *spi) ...@@ -448,7 +448,9 @@ static int tpg110_probe(struct spi_device *spi)
spi_set_drvdata(spi, tpg); spi_set_drvdata(spi, tpg);
return drm_panel_add(&tpg->panel); drm_panel_add(&tpg->panel);
return 0;
} }
static int tpg110_remove(struct spi_device *spi) static int tpg110_remove(struct spi_device *spi)
......
...@@ -175,7 +175,7 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev, ...@@ -175,7 +175,7 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
const struct drm_panel_funcs *funcs, const struct drm_panel_funcs *funcs,
int connector_type); int connector_type);
int drm_panel_add(struct drm_panel *panel); void drm_panel_add(struct drm_panel *panel);
void drm_panel_remove(struct drm_panel *panel); void drm_panel_remove(struct drm_panel *panel);
int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector); int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);
......
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