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: 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
This commit is contained in:
Bernard Zhao 2020-08-01 20:02:13 +08:00 committed by Sam Ravnborg
parent 1a3fb59085
commit c3ee8c65f6
44 changed files with 82 additions and 111 deletions

View File

@ -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);

View File

@ -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[] = {

View File

@ -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) {

View File

@ -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)

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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;
}

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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,
@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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)
@ -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;

View File

@ -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)
@ -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;

View File

@ -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)

View File

@ -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) {

View File

@ -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)

View File

@ -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);

View File

@ -325,7 +325,9 @@ static int sharp_panel_add(struct sharp_panel *sharp)
if (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)

View File

@ -187,7 +187,9 @@ static int ls037v7dw01_probe(struct platform_device *pdev)
drm_panel_init(&lcd->panel, &pdev->dev, &ls037v7dw01_funcs,
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)

View File

@ -261,7 +261,9 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
if (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)

View File

@ -613,9 +613,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
if (err)
goto free_ddc;
err = drm_panel_add(&panel->base);
if (err < 0)
goto free_ddc;
drm_panel_add(&panel->base);
dev_set_drvdata(dev, panel);

View File

@ -380,9 +380,7 @@ static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
if (ret)
return ret;
ret = drm_panel_add(&st7701->panel);
if (ret < 0)
return ret;
drm_panel_add(&st7701->panel);
mipi_dsi_set_drvdata(dsi, st7701);
st7701->dsi = dsi;

View File

@ -382,9 +382,7 @@ static int st7789v_probe(struct spi_device *spi)
if (ret)
return ret;
ret = drm_panel_add(&ctx->panel);
if (ret < 0)
return ret;
drm_panel_add(&ctx->panel);
return 0;
}

View File

@ -504,9 +504,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi)
acx->bl->props.brightness = 512;
acx->bl->props.power = FB_BLANK_POWERDOWN;
ret = drm_panel_add(&acx->panel);
if (ret < 0)
return ret;
drm_panel_add(&acx->panel);
ret = mipi_dsi_attach(dsi);
if (ret < 0) {

View File

@ -650,12 +650,7 @@ static int acx565akm_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &acx565akm_funcs,
DRM_MODE_CONNECTOR_DPI);
ret = drm_panel_add(&lcd->panel);
if (ret < 0) {
if (lcd->has_bc)
acx565akm_backlight_cleanup(lcd);
return ret;
}
drm_panel_add(&lcd->panel);
return 0;
}

View File

@ -350,7 +350,9 @@ static int td028ttec1_probe(struct spi_device *spi)
if (ret)
return ret;
return drm_panel_add(&lcd->panel);
drm_panel_add(&lcd->panel);
return 0;
}
static int td028ttec1_remove(struct spi_device *spi)

View File

@ -460,11 +460,7 @@ static int td043mtea1_probe(struct spi_device *spi)
drm_panel_init(&lcd->panel, &lcd->spi->dev, &td043mtea1_funcs,
DRM_MODE_CONNECTOR_DPI);
ret = drm_panel_add(&lcd->panel);
if (ret < 0) {
sysfs_remove_group(&spi->dev.kobj, &td043mtea1_attr_group);
return ret;
}
drm_panel_add(&lcd->panel);
return 0;
}

View File

@ -448,7 +448,9 @@ static int tpg110_probe(struct spi_device *spi)
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)

View File

@ -175,7 +175,7 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev,
const struct drm_panel_funcs *funcs,
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);
int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);