Commit 47d4bb6b authored by AngeloGioacchino Del Regno's avatar AngeloGioacchino Del Regno Committed by Chun-Kuang Hu
Browse files

drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add()

parent 63ee9438
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1090,11 +1090,12 @@ static int mtk_dpi_probe(struct platform_device *pdev)
	dpi->bridge.of_node = dev->of_node;
	dpi->bridge.type = DRM_MODE_CONNECTOR_DPI;

	drm_bridge_add(&dpi->bridge);
	ret = devm_drm_bridge_add(dev, &dpi->bridge);
	if (ret)
		return ret;

	ret = component_add(dev, &mtk_dpi_component_ops);
	if (ret) {
		drm_bridge_remove(&dpi->bridge);
		dev_err(dev, "Failed to add component: %d\n", ret);
		return ret;
	}
@@ -1104,10 +1105,7 @@ static int mtk_dpi_probe(struct platform_device *pdev)

static int mtk_dpi_remove(struct platform_device *pdev)
{
	struct mtk_dpi *dpi = platform_get_drvdata(pdev);

	component_del(&pdev->dev, &mtk_dpi_component_ops);
	drm_bridge_remove(&dpi->bridge);

	return 0;
}