dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups
@ 2023-07-26  8:22 AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add() AngeloGioacchino Del Regno
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

Changes in v3:
 - Fixed removal of mtk_dpi pointer in mtk_dpi_remove on patch [1/6]
   instead of patch [3/6]; thanks CK Hu!

Changes in v2:
 - Removed drm_bridge_remove() call in patch 1
 - Added dev_err_probe print to devm_drm_of_get_bridge()
   call error handling
 - Switched to devm_platform_ioremap_resource() to remove
   the useless pointer to struct resource in probe function
 - Added a commit to compress struct of_device_id entries
 - Added a commit to switch to .remove_new() callback

This is a small cleanup of the mtk-dpi driver, switching it to devm
variants where possible and where it made sense, and reducing lines
while retaining and improving human readability.

AngeloGioacchino Del Regno (6):
  drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add()
  drm/mediatek: mtk_dpi: Simplify with dev_err_probe()
  drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge()
  drm/mediatek: mtk_dpi: Switch to .remove_new() void callback
  drm/mediatek: mtk_dpi: Use devm_platform_ioremap_resource()
  drm/mediatek: mtk_dpi: Compress struct of_device_id entries

 drivers/gpu/drm/mediatek/mtk_dpi.c | 100 +++++++++--------------------
 1 file changed, 32 insertions(+), 68 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add()
  2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
@ 2023-07-26  8:22 ` AngeloGioacchino Del Regno
  2023-07-27  3:11   ` CK Hu (胡俊光)
  2023-07-26  8:22 ` [PATCH v3 2/6] drm/mediatek: mtk_dpi: Simplify with dev_err_probe() AngeloGioacchino Del Regno
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

Change drm_bridge_add() to its devm variant to slightly simplify the
probe function.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 28bdb1f427ff..e4ee0d02893a 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1089,11 +1089,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;
 	}
@@ -1103,10 +1104,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;
 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 2/6] drm/mediatek: mtk_dpi: Simplify with dev_err_probe()
  2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add() AngeloGioacchino Del Regno
@ 2023-07-26  8:22 ` AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge() AngeloGioacchino Del Regno
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

Use dev_err_probe() across the entire probe function of this driver
to shrink the size.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 44 ++++++++++--------------------
 1 file changed, 14 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index e4ee0d02893a..fdd5b7126e27 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1039,38 +1039,24 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 	}
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dpi->regs = devm_ioremap_resource(dev, mem);
-	if (IS_ERR(dpi->regs)) {
-		ret = PTR_ERR(dpi->regs);
-		dev_err(dev, "Failed to ioremap mem resource: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(dpi->regs))
+		return dev_err_probe(dev, PTR_ERR(dpi->regs),
+				     "Failed to ioremap mem resource\n");
 
 	dpi->engine_clk = devm_clk_get(dev, "engine");
-	if (IS_ERR(dpi->engine_clk)) {
-		ret = PTR_ERR(dpi->engine_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "Failed to get engine clock: %d\n", ret);
-
-		return ret;
-	}
+	if (IS_ERR(dpi->engine_clk))
+		return dev_err_probe(dev, PTR_ERR(dpi->engine_clk),
+				     "Failed to get engine clock\n");
 
 	dpi->pixel_clk = devm_clk_get(dev, "pixel");
-	if (IS_ERR(dpi->pixel_clk)) {
-		ret = PTR_ERR(dpi->pixel_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "Failed to get pixel clock: %d\n", ret);
-
-		return ret;
-	}
+	if (IS_ERR(dpi->pixel_clk))
+		return dev_err_probe(dev, PTR_ERR(dpi->pixel_clk),
+				     "Failed to get pixel clock\n");
 
 	dpi->tvd_clk = devm_clk_get(dev, "pll");
-	if (IS_ERR(dpi->tvd_clk)) {
-		ret = PTR_ERR(dpi->tvd_clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "Failed to get tvdpll clock: %d\n", ret);
-
-		return ret;
-	}
+	if (IS_ERR(dpi->tvd_clk))
+		return dev_err_probe(dev, PTR_ERR(dpi->tvd_clk),
+				     "Failed to get tvdpll clock\n");
 
 	dpi->irq = platform_get_irq(pdev, 0);
 	if (dpi->irq <= 0)
@@ -1094,10 +1080,8 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 		return ret;
 
 	ret = component_add(dev, &mtk_dpi_component_ops);
-	if (ret) {
-		dev_err(dev, "Failed to add component: %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to add component.\n");
 
 	return 0;
 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge()
  2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add() AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 2/6] drm/mediatek: mtk_dpi: Simplify with dev_err_probe() AngeloGioacchino Del Regno
@ 2023-07-26  8:22 ` AngeloGioacchino Del Regno
  2023-07-27  3:24   ` CK Hu (胡俊光)
  2023-07-26  8:22 ` [PATCH v3 4/6] drm/mediatek: mtk_dpi: Switch to .remove_new() void callback AngeloGioacchino Del Regno
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

Function drm_of_find_panel_or_bridge() is marked as deprecated: since
the usage of that in this driver exactly corresponds to the new function
devm_drm_of_get_bridge(), switch to it.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index fdd5b7126e27..08822fe88c93 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1062,10 +1062,10 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 	if (dpi->irq <= 0)
 		return -EINVAL;
 
-	ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
-					  NULL, &dpi->next_bridge);
-	if (ret)
-		return ret;
+	dpi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0);
+	if (IS_ERR(dpi->next_bridge))
+		return dev_err_probe(dev, PTR_ERR(dpi->next_bridge),
+				     "Failed to get bridge\n");
 
 	dev_info(dev, "Found bridge node: %pOF\n", dpi->next_bridge->of_node);
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 4/6] drm/mediatek: mtk_dpi: Switch to .remove_new() void callback
  2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
                   ` (2 preceding siblings ...)
  2023-07-26  8:22 ` [PATCH v3 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge() AngeloGioacchino Del Regno
@ 2023-07-26  8:22 ` AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 5/6] drm/mediatek: mtk_dpi: Use devm_platform_ioremap_resource() AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 6/6] drm/mediatek: mtk_dpi: Compress struct of_device_id entries AngeloGioacchino Del Regno
  5 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

The .remove() callback cannot fail: switch to .remove_new() and
change mtk_dpi_remove() to void.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 08822fe88c93..2c95de5539fd 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1086,11 +1086,9 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mtk_dpi_remove(struct platform_device *pdev)
+static void mtk_dpi_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &mtk_dpi_component_ops);
-
-	return 0;
 }
 
 static const struct of_device_id mtk_dpi_of_ids[] = {
@@ -1121,7 +1119,7 @@ MODULE_DEVICE_TABLE(of, mtk_dpi_of_ids);
 
 struct platform_driver mtk_dpi_driver = {
 	.probe = mtk_dpi_probe,
-	.remove = mtk_dpi_remove,
+	.remove_new = mtk_dpi_remove,
 	.driver = {
 		.name = "mediatek-dpi",
 		.of_match_table = mtk_dpi_of_ids,
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 5/6] drm/mediatek: mtk_dpi: Use devm_platform_ioremap_resource()
  2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
                   ` (3 preceding siblings ...)
  2023-07-26  8:22 ` [PATCH v3 4/6] drm/mediatek: mtk_dpi: Switch to .remove_new() void callback AngeloGioacchino Del Regno
@ 2023-07-26  8:22 ` AngeloGioacchino Del Regno
  2023-07-26  8:22 ` [PATCH v3 6/6] drm/mediatek: mtk_dpi: Compress struct of_device_id entries AngeloGioacchino Del Regno
  5 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

Instead of the open-coded platform_get_resource, devm_ioremap_resource
switch to devm_platform_ioremap_resource(), also dropping the useless
struct resource pointer, which becomes unused.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 2c95de5539fd..a6fa26301a58 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1006,7 +1006,6 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct mtk_dpi *dpi;
-	struct resource *mem;
 	int ret;
 
 	dpi = devm_kzalloc(dev, sizeof(*dpi), GFP_KERNEL);
@@ -1037,8 +1036,7 @@ static int mtk_dpi_probe(struct platform_device *pdev)
 			dev_dbg(&pdev->dev, "Cannot find pinctrl active!\n");
 		}
 	}
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dpi->regs = devm_ioremap_resource(dev, mem);
+	dpi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dpi->regs))
 		return dev_err_probe(dev, PTR_ERR(dpi->regs),
 				     "Failed to ioremap mem resource\n");
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 6/6] drm/mediatek: mtk_dpi: Compress struct of_device_id entries
  2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
                   ` (4 preceding siblings ...)
  2023-07-26  8:22 ` [PATCH v3 5/6] drm/mediatek: mtk_dpi: Use devm_platform_ioremap_resource() AngeloGioacchino Del Regno
@ 2023-07-26  8:22 ` AngeloGioacchino Del Regno
  5 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-07-26  8:22 UTC (permalink / raw)
  To: chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel, angelogioacchino.delregno

Reduce line count by compressing the entries of struct of_device_id;
while at it, also add the usual /* sentinel */ comment to the last
entry.

This commit brings no functional changes.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_dpi.c | 30 ++++++++----------------------
 1 file changed, 8 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index a6fa26301a58..cc55dbb909ec 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1090,28 +1090,14 @@ static void mtk_dpi_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id mtk_dpi_of_ids[] = {
-	{ .compatible = "mediatek,mt2701-dpi",
-	  .data = &mt2701_conf,
-	},
-	{ .compatible = "mediatek,mt8173-dpi",
-	  .data = &mt8173_conf,
-	},
-	{ .compatible = "mediatek,mt8183-dpi",
-	  .data = &mt8183_conf,
-	},
-	{ .compatible = "mediatek,mt8186-dpi",
-	  .data = &mt8186_conf,
-	},
-	{ .compatible = "mediatek,mt8188-dp-intf",
-	  .data = &mt8188_dpintf_conf,
-	},
-	{ .compatible = "mediatek,mt8192-dpi",
-	  .data = &mt8192_conf,
-	},
-	{ .compatible = "mediatek,mt8195-dp-intf",
-	  .data = &mt8195_dpintf_conf,
-	},
-	{ },
+	{ .compatible = "mediatek,mt2701-dpi", .data = &mt2701_conf },
+	{ .compatible = "mediatek,mt8173-dpi", .data = &mt8173_conf },
+	{ .compatible = "mediatek,mt8183-dpi", .data = &mt8183_conf },
+	{ .compatible = "mediatek,mt8186-dpi", .data = &mt8186_conf },
+	{ .compatible = "mediatek,mt8188-dp-intf", .data = &mt8188_dpintf_conf },
+	{ .compatible = "mediatek,mt8192-dpi", .data = &mt8192_conf },
+	{ .compatible = "mediatek,mt8195-dp-intf", .data = &mt8195_dpintf_conf },
+	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, mtk_dpi_of_ids);
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add()
  2023-07-26  8:22 ` [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add() AngeloGioacchino Del Regno
@ 2023-07-27  3:11   ` CK Hu (胡俊光)
  0 siblings, 0 replies; 9+ messages in thread
From: CK Hu (胡俊光) @ 2023-07-27  3:11 UTC (permalink / raw)
  To: angelogioacchino.delregno, chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel

[-- Attachment #1: Type: text/html, Size: 3245 bytes --]

[-- Attachment #2: Type: text/plain, Size: 1529 bytes --]

Hi, Angelo:

On Wed, 2023-07-26 at 10:22 +0200, AngeloGioacchino Del Regno wrote:
> Change drm_bridge_add() to its devm variant to slightly simplify the
> probe function.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> Reviewed-by: Fei Shao <fshao@chromium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_dpi.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c
> b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index 28bdb1f427ff..e4ee0d02893a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -1089,11 +1089,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;
>  	}
> @@ -1103,10 +1104,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;
>  }

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge()
  2023-07-26  8:22 ` [PATCH v3 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge() AngeloGioacchino Del Regno
@ 2023-07-27  3:24   ` CK Hu (胡俊光)
  0 siblings, 0 replies; 9+ messages in thread
From: CK Hu (胡俊光) @ 2023-07-27  3:24 UTC (permalink / raw)
  To: angelogioacchino.delregno, chunkuang.hu
  Cc: fshao, linux-kernel, dri-devel, linux-mediatek, matthias.bgg,
	kernel, linux-arm-kernel

[-- Attachment #1: Type: text/html, Size: 3002 bytes --]

[-- Attachment #2: Type: text/plain, Size: 1367 bytes --]

Hi, Angelo:

On Wed, 2023-07-26 at 10:22 +0200, AngeloGioacchino Del Regno wrote:
> Function drm_of_find_panel_or_bridge() is marked as deprecated: since
> the usage of that in this driver exactly corresponds to the new
> function
> devm_drm_of_get_bridge(), switch to it.

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> Reviewed-by: Fei Shao <fshao@chromium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_dpi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c
> b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index fdd5b7126e27..08822fe88c93 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -1062,10 +1062,10 @@ static int mtk_dpi_probe(struct
> platform_device *pdev)
>  	if (dpi->irq <= 0)
>  		return -EINVAL;
>  
> -	ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
> -					  NULL, &dpi->next_bridge);
> -	if (ret)
> -		return ret;
> +	dpi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0,
> 0);
> +	if (IS_ERR(dpi->next_bridge))
> +		return dev_err_probe(dev, PTR_ERR(dpi->next_bridge),
> +				     "Failed to get bridge\n");
>  
>  	dev_info(dev, "Found bridge node: %pOF\n", dpi->next_bridge-
> >of_node);
>  

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-27  3:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26  8:22 [PATCH v3 0/6] drm/mediatek: Small mtk-dpi cleanups AngeloGioacchino Del Regno
2023-07-26  8:22 ` [PATCH v3 1/6] drm/mediatek: mtk_dpi: Simplify with devm_drm_bridge_add() AngeloGioacchino Del Regno
2023-07-27  3:11   ` CK Hu (胡俊光)
2023-07-26  8:22 ` [PATCH v3 2/6] drm/mediatek: mtk_dpi: Simplify with dev_err_probe() AngeloGioacchino Del Regno
2023-07-26  8:22 ` [PATCH v3 3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge() AngeloGioacchino Del Regno
2023-07-27  3:24   ` CK Hu (胡俊光)
2023-07-26  8:22 ` [PATCH v3 4/6] drm/mediatek: mtk_dpi: Switch to .remove_new() void callback AngeloGioacchino Del Regno
2023-07-26  8:22 ` [PATCH v3 5/6] drm/mediatek: mtk_dpi: Use devm_platform_ioremap_resource() AngeloGioacchino Del Regno
2023-07-26  8:22 ` [PATCH v3 6/6] drm/mediatek: mtk_dpi: Compress struct of_device_id entries AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).