diff mbox series

[v2,3/6] drm/mediatek: mtk_dpi: Switch to devm_drm_of_get_bridge()

Message ID 20230719075056.72178-4-angelogioacchino.delregno@collabora.com (mailing list archive)
State New, archived
Headers show
Series drm/mediatek: Small mtk-dpi cleanups | expand

Commit Message

AngeloGioacchino Del Regno July 19, 2023, 7:50 a.m. UTC
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 | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

CK Hu (胡俊光) July 26, 2023, 5:41 a.m. UTC | #1
Hi, Angelo:

On Wed, 2023-07-19 at 09:50 +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.
> 
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> Reviewed-by: Fei Shao <fshao@chromium.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_dpi.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c
> b/drivers/gpu/drm/mediatek/mtk_dpi.c
> index 03a2b900bb50..e9c5a0f44537 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> @@ -1063,10 +1063,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);
>  
> @@ -1089,8 +1089,6 @@ 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);

Move this to the patch of "Simplify with devm_drm_bridge_add()".

Regards,
CK

> -
>  	component_del(&pdev->dev, &mtk_dpi_component_ops);
>  
>  	return 0;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 03a2b900bb50..e9c5a0f44537 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -1063,10 +1063,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);
 
@@ -1089,8 +1089,6 @@  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);
 
 	return 0;