mbox series

[v7,0/9] of: property: add of_graph_get_next_port/port_endpoint()

Message ID 87wmiirqwy.wl-kuninori.morimoto.gx@renesas.com
Headers show
Series of: property: add of_graph_get_next_port/port_endpoint() | expand

Message

Kuninori Morimoto Oct. 9, 2024, 1:44 a.m. UTC
Hi Rob, Saravana, Tomi, Laurent, Sakari, Mark

This is v7 patch-set

Current Of-graph has "endpoint base" for loop, but doesn't have
"port base" loop. "endpoint base" loop only is not enough.
This patch-set add new "port base" for loop, and use it.

v6 -> v7
	- based on latest linus/master branch
	- remove "ports" base functions
	- use "port" base function on "endpoint" function ([3/9])
	- tidyup [1/9] explanation

v5 -> v6
	- based on latest linus/master branch
	- [9/9]: fixed compile warrning

v4 -> v5
	- tidyup comments
	- [8/9]: parent NULL check was removed
	- [9/9]: use for_each_of_graph_port()

v3 -> v4
	- new for_each loop includes __free()
	 - comment indicates to use return_ptr() or no_free_ptr() if
	   it need to continue to use node
	 - each driver based on it
	- care "prev" leak on of_graph_get_next_ports()
	- of_graph_get_next_port_endpoint() indicates WARN() if port
	  has non-endpoint node
	- tidyup each git-log

v2 -> v3
	- return NULL if it it doesn't have ports / port
	- add visible comment on of_graph_get_next_ports()

v1 -> v2
	- add each Reviewed-by / Acked-by
	- tidyup/update Kernel Docs
	- use prev as parameter
	- update git-log explanation
	- remove extra changes

Kuninori Morimoto (9):
  of: property: add of_graph_get_next_port()
  of: property: add of_graph_get_next_port_endpoint()
  of: property: use new of_graph functions
  ASoC: test-component: use new of_graph functions
  ASoC: audio-graph-card: use new of_graph functions
  ASoC: audio-graph-card2: use new of_graph functions
  gpu: drm: omapdrm: use new of_graph functions
  fbdev: omapfb: use new of_graph functions
  media: xilinx-tpg: use new of_graph functions

 drivers/gpu/drm/omapdrm/dss/dpi.c             |   3 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c             |   3 +-
 drivers/media/platform/xilinx/xilinx-tpg.c    |  14 +--
 drivers/of/property.c                         |  99 ++++++++++++++---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c |  66 -----------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |  20 ++--
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |   3 +-
 include/linux/of_graph.h                      |  49 +++++++++
 include/video/omapfb_dss.h                    |   8 --
 sound/soc/generic/audio-graph-card.c          |   2 +-
 sound/soc/generic/audio-graph-card2.c         | 104 ++++++++----------
 sound/soc/generic/test-component.c            |   3 +-
 13 files changed, 205 insertions(+), 172 deletions(-)

Comments

Rob Herring (Arm) Oct. 15, 2024, 3:49 p.m. UTC | #1
On Wed, Oct 09, 2024 at 01:44:30AM +0000, Kuninori Morimoto wrote:
> 
> Hi Rob, Saravana, Tomi, Laurent, Sakari, Mark
> 
> This is v7 patch-set
> 
> Current Of-graph has "endpoint base" for loop, but doesn't have
> "port base" loop. "endpoint base" loop only is not enough.
> This patch-set add new "port base" for loop, and use it.
> 
> v6 -> v7
> 	- based on latest linus/master branch
> 	- remove "ports" base functions
> 	- use "port" base function on "endpoint" function ([3/9])
> 	- tidyup [1/9] explanation
> 
> v5 -> v6
> 	- based on latest linus/master branch
> 	- [9/9]: fixed compile warrning
> 
> v4 -> v5
> 	- tidyup comments
> 	- [8/9]: parent NULL check was removed
> 	- [9/9]: use for_each_of_graph_port()
> 
> v3 -> v4
> 	- new for_each loop includes __free()
> 	 - comment indicates to use return_ptr() or no_free_ptr() if
> 	   it need to continue to use node
> 	 - each driver based on it
> 	- care "prev" leak on of_graph_get_next_ports()
> 	- of_graph_get_next_port_endpoint() indicates WARN() if port
> 	  has non-endpoint node
> 	- tidyup each git-log
> 
> v2 -> v3
> 	- return NULL if it it doesn't have ports / port
> 	- add visible comment on of_graph_get_next_ports()
> 
> v1 -> v2
> 	- add each Reviewed-by / Acked-by
> 	- tidyup/update Kernel Docs
> 	- use prev as parameter
> 	- update git-log explanation
> 	- remove extra changes
> 
> Kuninori Morimoto (9):
>   of: property: add of_graph_get_next_port()
>   of: property: add of_graph_get_next_port_endpoint()
>   of: property: use new of_graph functions
>   ASoC: test-component: use new of_graph functions
>   ASoC: audio-graph-card: use new of_graph functions
>   ASoC: audio-graph-card2: use new of_graph functions
>   gpu: drm: omapdrm: use new of_graph functions
>   fbdev: omapfb: use new of_graph functions
>   media: xilinx-tpg: use new of_graph functions

The DT parts look fine to me now. I see Mark acked this so he's not 
expecting to take it. I can take it, but need acks on the fbdev and 
media patches.

Rob
Helge Deller Oct. 15, 2024, 6:51 p.m. UTC | #2
On 10/9/24 03:45, Kuninori Morimoto wrote:
> Now we can use new port related functions for port parsing. Use it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Acked-by: Helge Deller <deller@gmx.de>

> ---
>   drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |  3 +-
>   drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 66 -------------------
>   drivers/video/fbdev/omap2/omapfb/dss/dss.c    | 20 +++---
>   drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |  3 +-
>   include/video/omapfb_dss.h                    |  8 ---
>   5 files changed, 13 insertions(+), 87 deletions(-)
Helge Deller Oct. 15, 2024, 6:53 p.m. UTC | #3
On 10/9/24 03:45, Kuninori Morimoto wrote:
> Now we can use new port related functions for port parsing. Use it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Acked-by: Helge Deller <deller@gmx.de>

> ---
>   drivers/gpu/drm/omapdrm/dss/dpi.c | 3 ++-
>   drivers/gpu/drm/omapdrm/dss/sdi.c | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
> index 030f997eccd0..b17e77f700dd 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dpi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
> @@ -16,6 +16,7 @@
>   #include <linux/export.h>
>   #include <linux/kernel.h>
>   #include <linux/of.h>
> +#include <linux/of_graph.h>
>   #include <linux/platform_device.h>
>   #include <linux/regulator/consumer.h>
>   #include <linux/string.h>
> @@ -709,7 +710,7 @@ int dpi_init_port(struct dss_device *dss, struct platform_device *pdev,
>   	if (!dpi)
>   		return -ENOMEM;
>
> -	ep = of_get_next_child(port, NULL);
> +	ep = of_graph_get_next_port_endpoint(port, NULL);
>   	if (!ep)
>   		return 0;
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c
> index 91eaae3b9481..f9ae358e8e52 100644
> --- a/drivers/gpu/drm/omapdrm/dss/sdi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
> @@ -11,6 +11,7 @@
>   #include <linux/export.h>
>   #include <linux/kernel.h>
>   #include <linux/of.h>
> +#include <linux/of_graph.h>
>   #include <linux/platform_device.h>
>   #include <linux/regulator/consumer.h>
>   #include <linux/string.h>
> @@ -346,7 +347,7 @@ int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,
>   	if (!sdi)
>   		return -ENOMEM;
>
> -	ep = of_get_next_child(port, NULL);
> +	ep = of_graph_get_next_port_endpoint(port, NULL);
>   	if (!ep) {
>   		r = 0;
>   		goto err_free;
Helge Deller Oct. 15, 2024, 6:54 p.m. UTC | #4
On 10/15/24 17:49, Rob Herring wrote:
> On Wed, Oct 09, 2024 at 01:44:30AM +0000, Kuninori Morimoto wrote:
>>
>> Hi Rob, Saravana, Tomi, Laurent, Sakari, Mark
>>
>> This is v7 patch-set
>>
>> Current Of-graph has "endpoint base" for loop, but doesn't have
>> "port base" loop. "endpoint base" loop only is not enough.
>> This patch-set add new "port base" for loop, and use it.
>>
>> v6 -> v7
>> 	- based on latest linus/master branch
>> 	- remove "ports" base functions
>> 	- use "port" base function on "endpoint" function ([3/9])
>> 	- tidyup [1/9] explanation
>>
>> v5 -> v6
>> 	- based on latest linus/master branch
>> 	- [9/9]: fixed compile warrning
>>
>> v4 -> v5
>> 	- tidyup comments
>> 	- [8/9]: parent NULL check was removed
>> 	- [9/9]: use for_each_of_graph_port()
>>
>> v3 -> v4
>> 	- new for_each loop includes __free()
>> 	 - comment indicates to use return_ptr() or no_free_ptr() if
>> 	   it need to continue to use node
>> 	 - each driver based on it
>> 	- care "prev" leak on of_graph_get_next_ports()
>> 	- of_graph_get_next_port_endpoint() indicates WARN() if port
>> 	  has non-endpoint node
>> 	- tidyup each git-log
>>
>> v2 -> v3
>> 	- return NULL if it it doesn't have ports / port
>> 	- add visible comment on of_graph_get_next_ports()
>>
>> v1 -> v2
>> 	- add each Reviewed-by / Acked-by
>> 	- tidyup/update Kernel Docs
>> 	- use prev as parameter
>> 	- update git-log explanation
>> 	- remove extra changes
>>
>> Kuninori Morimoto (9):
>>    of: property: add of_graph_get_next_port()
>>    of: property: add of_graph_get_next_port_endpoint()
>>    of: property: use new of_graph functions
>>    ASoC: test-component: use new of_graph functions
>>    ASoC: audio-graph-card: use new of_graph functions
>>    ASoC: audio-graph-card2: use new of_graph functions
>>    gpu: drm: omapdrm: use new of_graph functions
>>    fbdev: omapfb: use new of_graph functions
>>    media: xilinx-tpg: use new of_graph functions
>
> The DT parts look fine to me now. I see Mark acked this so he's not
> expecting to take it. I can take it,

Speaking for fbdev, I'd be happy if you take them.

> but need acks on the fbdev and media patches.

I just sent Ack for fbdev/drm.

Helge
Sakari Ailus Oct. 22, 2024, 7:38 a.m. UTC | #5
Hi Morimoto-san, Rob,

On Wed, Oct 09, 2024 at 01:45:36AM +0000, Kuninori Morimoto wrote:
> Now we can use new port related functions for port parsing. Use it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

I.e. it's ok to merge this via non-media tree.