[PATCH 2/4] drm/sti: make use of drm_of_component_probe

Raphael Gallais-Pou posted 4 patches 2 months, 2 weeks ago
[PATCH 2/4] drm/sti: make use of drm_of_component_probe
Posted by Raphael Gallais-Pou 2 months, 2 weeks ago
Enhance the probing sequence by using the ports property of the
display-subsystem node.

That done, it becomes possible to handle the display-substem node
outside of the soc node within the device-tree and not have each IP
blocks as children of the display-subsystem node.

Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
---
 drivers/gpu/drm/sti/sti_drv.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 42f21ab91957b38cb9aef012b6ee7f4ae1683edf..9d6a7c8fa0759c0b6fedf87169b18cff3684be46 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -231,9 +231,6 @@ static const struct component_master_ops sti_ops = {
 static int sti_platform_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	struct device_node *node = dev->of_node;
-	struct device_node *child_np;
-	struct component_match *match = NULL;
 	int ret;
 
 	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
@@ -242,15 +239,7 @@ static int sti_platform_probe(struct platform_device *pdev)
 
 	devm_of_platform_populate(dev);
 
-	child_np = of_get_next_available_child(node, NULL);
-
-	while (child_np) {
-		drm_of_component_match_add(dev, &match, component_compare_of,
-					   child_np);
-		child_np = of_get_next_available_child(node, child_np);
-	}
-
-	return component_master_add_with_match(dev, &sti_ops, match);
+	return drm_of_component_probe(dev, component_compare_of, &sti_ops);
 }
 
 static void sti_platform_remove(struct platform_device *pdev)

-- 
2.50.1
Re: [PATCH 2/4] drm/sti: make use of drm_of_component_probe
Posted by Alain Volmat 3 weeks, 3 days ago
Hello Raphael,

Thanks for this patch.

On Thu, Jul 17, 2025 at 09:15:33PM +0200, Raphael Gallais-Pou wrote:
> Enhance the probing sequence by using the ports property of the
> display-subsystem node.
> 
> That done, it becomes possible to handle the display-substem node
> outside of the soc node within the device-tree and not have each IP
> blocks as children of the display-subsystem node.
> 
> Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
> ---
>  drivers/gpu/drm/sti/sti_drv.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
> index 42f21ab91957b38cb9aef012b6ee7f4ae1683edf..9d6a7c8fa0759c0b6fedf87169b18cff3684be46 100644
> --- a/drivers/gpu/drm/sti/sti_drv.c
> +++ b/drivers/gpu/drm/sti/sti_drv.c
> @@ -231,9 +231,6 @@ static const struct component_master_ops sti_ops = {
>  static int sti_platform_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
> -	struct device_node *node = dev->of_node;
> -	struct device_node *child_np;
> -	struct component_match *match = NULL;
>  	int ret;
>  
>  	ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
> @@ -242,15 +239,7 @@ static int sti_platform_probe(struct platform_device *pdev)
>  
>  	devm_of_platform_populate(dev);
>  
> -	child_np = of_get_next_available_child(node, NULL);
> -
> -	while (child_np) {
> -		drm_of_component_match_add(dev, &match, component_compare_of,
> -					   child_np);
> -		child_np = of_get_next_available_child(node, child_np);
> -	}
> -
> -	return component_master_add_with_match(dev, &sti_ops, match);
> +	return drm_of_component_probe(dev, component_compare_of, &sti_ops);
>  }
>  
>  static void sti_platform_remove(struct platform_device *pdev)
> 
> -- 
> 2.50.1
> 

Acked-by: Alain Volmat <alain.volmat@foss.st.com>

Best regards
Alain