Skip to content

Commit

Permalink
drm/panel: remove return value of function drm_panel_add
Browse files Browse the repository at this point in the history
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: Bernard Zhao <bernard@vivo.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200801120216.8488-1-bernard@vivo.com
  • Loading branch information
Bernard Zhao authored and Sam Ravnborg committed Aug 2, 2020
1 parent 1a3fb59 commit c3ee8c6
Show file tree
Hide file tree
Showing 44 changed files with 82 additions and 111 deletions.
6 changes: 1 addition & 5 deletions drivers/gpu/drm/drm_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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);
list_add_tail(&panel->list, &panel_list);
mutex_unlock(&panel_lock);

return 0;
}
EXPORT_SYMBOL(drm_panel_add);

Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-arm-versatile.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,9 @@ static int versatile_panel_probe(struct platform_device *pdev)
drm_panel_init(&vpanel->panel, dev, &versatile_panel_drm_funcs,
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[] = {
Expand Down
6 changes: 1 addition & 5 deletions drivers/gpu/drm/panel/panel-asus-z00t-tm5p5-n35596.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,7 @@ static int tm5p5_nt35596_probe(struct mipi_dsi_device *dsi)
return ret;
}

ret = drm_panel_add(&ctx->panel);
if (ret < 0) {
dev_err(dev, "Failed to add panel: %d\n", ret);
return ret;
}
drm_panel_add(&ctx->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0) {
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-boe-himax8279d.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,9 @@ static int panel_add(struct panel_info *pinfo)
if (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)
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,9 @@ static int boe_panel_add(struct boe_panel *boe)
boe->base.funcs = &boe_panel_funcs;
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)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-feixin-k101-im2ba02.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,7 @@ static int k101_im2ba02_dsi_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
drm_panel_add(&ctx->panel);

dsi->mode_flags = MIPI_DSI_MODE_VIDEO;
dsi->format = MIPI_DSI_FMT_RGB888;
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
drm_panel_add(&ctx->panel);

dsi->mode_flags = MIPI_DSI_MODE_VIDEO_BURST;
dsi->format = MIPI_DSI_FMT_RGB888;
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-ilitek-ili9322.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,9 @@ static int ili9322_probe(struct spi_device *spi)
drm_panel_init(&ili->panel, dev, &ili9322_drm_funcs,
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)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,7 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
drm_panel_add(&ctx->panel);

dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
dsi->format = MIPI_DSI_FMT_RGB888;
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-innolux-p079zca.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,7 @@ static int innolux_panel_add(struct mipi_dsi_device *dsi,
if (err)
return err;

err = drm_panel_add(&innolux->base);
if (err < 0)
return err;
drm_panel_add(&innolux->base);

mipi_dsi_set_drvdata(dsi, innolux);
innolux->link = dsi;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_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)
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ static int kingdisplay_panel_add(struct kingdisplay_panel *kingdisplay)
if (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)
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-lg-lb035q02.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ static int lb035q02_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &lb035q02_funcs,
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)
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-lg-lg4573.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ static int lg4573_probe(struct spi_device *spi)
drm_panel_init(&ctx->panel, &spi->dev, &lg4573_drm_funcs,
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)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ static int panel_lvds_probe(struct platform_device *pdev)
if (ret)
return ret;

ret = drm_panel_add(&lvds->panel);
if (ret < 0)
return ret;
drm_panel_add(&lvds->panel);

dev_set_drvdata(lvds->dev, lvds);
return 0;
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-nec-nl8048hl11.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ static int nl8048_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &nl8048_funcs,
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)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-novatek-nt35510.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
nt->panel.backlight = bl;
}

ret = drm_panel_add(&nt->panel);
if (ret < 0)
return ret;
drm_panel_add(&nt->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0)
Expand Down
6 changes: 1 addition & 5 deletions drivers/gpu/drm/panel/panel-novatek-nt39016.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,7 @@ static int nt39016_probe(struct spi_device *spi)
drm_panel_init(&panel->drm_panel, dev, &nt39016_funcs,
DRM_MODE_CONNECTOR_DPI);

err = drm_panel_add(&panel->drm_panel);
if (err < 0) {
dev_err(dev, "Failed to register panel");
return err;
}
drm_panel_add(&panel->drm_panel);

return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ static int lcd_olinuxino_probe(struct i2c_client *client,
if (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)
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ static int osd101t2587_panel_add(struct osd101t2587_panel *osd101t2587)
if (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)
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ static int wuxga_nt_panel_add(struct wuxga_nt_panel *wuxga_nt)
if (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)
Expand Down
6 changes: 2 additions & 4 deletions drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c,
struct rpi_touchscreen *ts;
struct device_node *endpoint, *dsi_host_node;
struct mipi_dsi_host *host;
int ret, ver;
int ver;
struct mipi_dsi_device_info info = {
.type = RPI_DSI_DRIVER_NAME,
.channel = 0,
Expand Down Expand Up @@ -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
* driver's component bind function.
*/
ret = drm_panel_add(&ts->base);
if (ret)
return ret;
drm_panel_add(&ts->base);

return 0;

Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-raydium-rm67191.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,7 @@ static int rad_panel_probe(struct mipi_dsi_device *dsi)
DRM_MODE_CONNECTOR_DSI);
dev_set_drvdata(dev, panel);

ret = drm_panel_add(&panel->panel);
if (ret)
return ret;
drm_panel_add(&panel->panel);

ret = mipi_dsi_attach(dsi);
if (ret)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-ronbo-rb070d30.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
drm_panel_add(&ctx->panel);

dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM;
dsi->format = MIPI_DSI_FMT_RGB888;
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-ld9040.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ static int ld9040_probe(struct spi_device *spi)
drm_panel_init(&ctx->panel, dev, &ld9040_drm_funcs,
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)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&s6->panel, dev, &s6d16d0_drm_funcs,
DRM_MODE_CONNECTOR_DSI);

ret = drm_panel_add(&s6->panel);
if (ret < 0)
return ret;
drm_panel_add(&s6->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0)
Expand Down
6 changes: 1 addition & 5 deletions drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs,
DRM_MODE_CONNECTOR_DSI);

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
goto unregister_backlight;
drm_panel_add(&ctx->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0)
Expand All @@ -745,8 +743,6 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)

remove_panel:
drm_panel_remove(&ctx->panel);

unregister_backlight:
backlight_device_unregister(ctx->bl_dev);

return ret;
Expand Down
6 changes: 1 addition & 5 deletions drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
ctx->bl_dev->props.brightness = DEFAULT_BRIGHTNESS;
ctx->bl_dev->props.power = FB_BLANK_POWERDOWN;

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
goto unregister_backlight;
drm_panel_add(&ctx->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0)
Expand All @@ -491,8 +489,6 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)

remove_panel:
drm_panel_remove(&ctx->panel);

unregister_backlight:
backlight_device_unregister(ctx->bl_dev);

return ret;
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/drm/panel/panel-samsung-s6e63m0.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ static int s6e63m0_probe(struct spi_device *spi)
if (ret < 0)
return ret;

return drm_panel_add(&ctx->panel);
drm_panel_add(&ctx->panel);

return 0;
}

static int s6e63m0_remove(struct spi_device *spi)
Expand Down
6 changes: 1 addition & 5 deletions drivers/gpu/drm/panel/panel-samsung-s6e88a0-ams452ef01.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_MODE_CONNECTOR_DSI);

ret = drm_panel_add(&ctx->panel);
if (ret < 0) {
dev_err(dev, "Failed to add panel: %d\n", ret);
return ret;
}
drm_panel_add(&ctx->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0) {
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,7 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)
drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs,
DRM_MODE_CONNECTOR_DSI);

ret = drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
drm_panel_add(&ctx->panel);

ret = mipi_dsi_attach(dsi);
if (ret < 0)
Expand Down
4 changes: 1 addition & 3 deletions drivers/gpu/drm/panel/panel-seiko-43wvf1g.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ static int seiko_panel_probe(struct device *dev,
if (err)
return err;

err = drm_panel_add(&panel->base);
if (err < 0)
return err;
drm_panel_add(&panel->base);

dev_set_drvdata(dev, panel);

Expand Down
Loading

0 comments on commit c3ee8c6

Please sign in to comment.