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

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
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -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);

+3 −1
Original line number Diff line number Diff line
@@ -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[] = {
+1 −5
Original line number Diff line number Diff line
@@ -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) {
+3 −1
Original line number Diff line number Diff line
@@ -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)
+3 −1
Original line number Diff line number Diff line
@@ -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)
Loading