All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/24] of: property: add port base loop
@ 2024-01-31  5:04 ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:04 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Kieran Bingham,
	Laurent Pinchart, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linu


Hi Rob

This is v3 of port base loop patch-set

We have "endpoint" base functions
	- of_graph_get_next_endpoint()
	- of_graph_get_endpoint_count()
	- for_each_endpoint_of_node()

But to handling "port" base things, it is not useful. We want to have
"port" base functions, too. This patch-set adds it.

Because current existing drivers couldn't use "port" base functions,
it were implemented in a different way. This patch-set doesn't try
to full-replace to avoid unknown bug, try easy / quick replace only
for now, but easy to know how "port" base functions are needed.

Because I can't test the driver which I can't use, non-ASoC drivers
needs Tested-by, Acked-by.

This patch-set renames existing "endpoint" to *_device_*
because it is rather than focusing to device's endpoint instead of
port's endpoint.

	- of_graph_get_next_endpoint()
	+ of_graph_get_next_device_endpoint()

	- of_graph_get_endpoint_count()
	+ of_graph_get_device_endpoint_count()

	- for_each_endpoint_of_node()
	+ for_each_device_endpoint_of_node()


[PATCH 01/24] - [PATCH 02/24] : tidyup existing endpoint function kerneldoc
[PATCH 03/24] - [PATCH 11/24] : replace existing function to *_device_*
[PATCH 12/24] - [PATCH 24/24] : add new function and use it

v2 -> v3
	- tidyup existing endpoint function kerneldoc
	- replace exising function to *_device_*

v1 -> v2
	- tidyup function explain
	- add missing header on each files

https://lore.kernel.org/r/87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com
https://lore.kernel.org/r/87fryhklhb.wl-kuninori.morimoto.gx@renesas.com


Kuninori Morimoto (24):
   1) of: property: add missing kerneldoc for of_graph_get_endpoint_count()
   2) of: property: use unsigned int return on of_graph_get_endpoint_count()
   3) of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint()
   4) video: fbdev: switch to use of_graph_get_next_device_endpoint()
   5) media: i2c: switch to use of_graph_get_next_device_endpoint()
   6) media: platform: switch to use of_graph_get_next_device_endpoint()
   7) gpu: drm: switch to use of_graph_get_next_device_endpoint()
   8) hwtracing: switch to use of_graph_get_next_device_endpoint()
   9) staging: switch to use of_graph_get_next_device_endpoint()
  10) ASoC: switch to use of_graph_get_next_device_endpoint()
  11) of: remove of_graph_get_next_endpoint() define
  12) of: property: add port base loop
  13) of: property: use of_graph_get_next_port() on of_graph_get_next_endpoint()
  14) of: property: add of_graph_get_next_endpoint()
  15) drm: omapdrm: use of_graph_get_next_endpoint()
  16) media: xilinx-tpg: use of_graph_get_next_endpoint()
  17) ASoC: audio-graph-card: use of_graph_get_next_endpoint()
  18) ASoC: audio-graph-card2: use of_graph_get_next_port()
  19) ASoC: audio-graph-card2: use of_graph_get_next_endpoint()
  20) ASoC: test-component: use for_each_port_of_node()
  21) fbdev: omapfb: use of_graph_get_remote_port()
  22) fbdev: omapfb: use of_graph_get_next_port()
  23) fbdev: omapfb: use of_graph_get_next_endpoint()
  24) fbdev: omapfb: use of_graph_get_next_device_endpoint()

 .clang-format                                 |   2 +-
 drivers/gpu/drm/armada/armada_drv.c           |   2 +-
 drivers/gpu/drm/bridge/tc358767.c             |   2 +-
 drivers/gpu/drm/drm_of.c                      |   6 +-
 drivers/gpu/drm/meson/meson_drv.c             |   4 +-
 drivers/gpu/drm/msm/msm_drv.c                 |   2 +-
 drivers/gpu/drm/mxsfb/lcdif_drv.c             |   2 +-
 drivers/gpu/drm/omapdrm/dss/base.c            |   2 +-
 drivers/gpu/drm/omapdrm/dss/dpi.c             |   2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c             |   2 +-
 .../drm/panel/panel-raspberrypi-touchscreen.c |   2 +-
 drivers/gpu/drm/pl111/pl111_drv.c             |   2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c |   2 +-
 drivers/gpu/drm/stm/ltdc.c                    |   4 +-
 drivers/gpu/drm/tiny/arcpgu.c                 |   2 +-
 .../hwtracing/coresight/coresight-platform.c  |   4 +-
 drivers/media/i2c/adv7343.c                   |   2 +-
 drivers/media/i2c/adv748x/adv748x-core.c      |   2 +-
 drivers/media/i2c/adv7604.c                   |   2 +-
 drivers/media/i2c/isl7998x.c                  |   2 +-
 drivers/media/i2c/max9286.c                   |   2 +-
 drivers/media/i2c/mt9p031.c                   |   2 +-
 drivers/media/i2c/mt9v032.c                   |   2 +-
 drivers/media/i2c/ov2659.c                    |   2 +-
 drivers/media/i2c/ov5645.c                    |   2 +-
 drivers/media/i2c/ov5647.c                    |   2 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c      |   2 +-
 drivers/media/i2c/s5k5baf.c                   |   2 +-
 drivers/media/i2c/tc358743.c                  |   2 +-
 drivers/media/i2c/tda1997x.c                  |   2 +-
 drivers/media/i2c/tvp514x.c                   |   2 +-
 drivers/media/i2c/tvp5150.c                   |   4 +-
 drivers/media/i2c/tvp7002.c                   |   2 +-
 drivers/media/platform/atmel/atmel-isi.c      |   4 +-
 drivers/media/platform/intel/pxa_camera.c     |   2 +-
 .../microchip/microchip-sama5d2-isc.c         |   2 +-
 .../microchip/microchip-sama7g5-isc.c         |   2 +-
 drivers/media/platform/qcom/camss/camss.c     |   2 +-
 drivers/media/platform/renesas/renesas-ceu.c  |   2 +-
 .../platform/samsung/exynos4-is/fimc-is.c     |   2 +-
 .../platform/samsung/exynos4-is/mipi-csis.c   |   2 +-
 drivers/media/platform/st/stm32/stm32-dcmi.c  |   4 +-
 .../media/platform/ti/am437x/am437x-vpfe.c    |   2 +-
 drivers/media/platform/ti/davinci/vpif.c      |   3 +-
 .../media/platform/ti/davinci/vpif_capture.c  |   3 +-
 drivers/media/platform/video-mux.c            |   2 +-
 drivers/media/platform/xilinx/xilinx-tpg.c    |   3 +-
 drivers/media/platform/xilinx/xilinx-vipp.c   |   2 +-
 drivers/of/property.c                         | 126 ++++++++++++++----
 .../deprecated/atmel/atmel-sama5d2-isc.c      |   2 +-
 .../deprecated/atmel/atmel-sama7g5-isc.c      |   2 +-
 drivers/staging/media/tegra-video/csi.c       |   2 +-
 drivers/staging/media/tegra-video/vi.c        |   2 +-
 drivers/staging/media/tegra-video/vip.c       |   2 +-
 drivers/video/fbdev/amba-clcd.c               |   2 +-
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 101 +-------------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |   9 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c  |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c  |   3 +-
 .../omap2/omapfb/dss/omapdss-boot-init.c      |   2 +-
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/venc.c   |   3 +-
 drivers/video/fbdev/pxafb.c                   |   2 +-
 include/linux/of_graph.h                      |  51 +++++--
 include/video/omapfb_dss.h                    |  11 --
 sound/soc/codecs/ak4613.c                     |   2 +-
 sound/soc/generic/audio-graph-card.c          |   2 +-
 sound/soc/generic/audio-graph-card2.c         |  33 ++---
 sound/soc/generic/simple-card-utils.c         |   6 +-
 sound/soc/generic/test-component.c            |   4 +-
 sound/soc/sh/rcar/core.c                      |   4 +-
 73 files changed, 247 insertions(+), 251 deletions(-)

-- 
2.25.1


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

* [PATCH v3 00/24] of: property: add port base loop
@ 2024-01-31  5:04 ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:04 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Kieran Bingham, Jernej Skrabec, Jessica Zhang,
	Mike Leach, devicetree, Jonas Karlman, Martin Blumenstingl,
	linux-arm-msm, coresight, linux-sound, linux-rpi-kernel,
	Jacopo Mondi, linux-amlogic, linux-omap, Sean Paul,
	linux-arm-kernel, linux-renesas-soc, Leo Yan, linux-media,
	freedreno


Hi Rob

This is v3 of port base loop patch-set

We have "endpoint" base functions
	- of_graph_get_next_endpoint()
	- of_graph_get_endpoint_count()
	- for_each_endpoint_of_node()

But to handling "port" base things, it is not useful. We want to have
"port" base functions, too. This patch-set adds it.

Because current existing drivers couldn't use "port" base functions,
it were implemented in a different way. This patch-set doesn't try
to full-replace to avoid unknown bug, try easy / quick replace only
for now, but easy to know how "port" base functions are needed.

Because I can't test the driver which I can't use, non-ASoC drivers
needs Tested-by, Acked-by.

This patch-set renames existing "endpoint" to *_device_*
because it is rather than focusing to device's endpoint instead of
port's endpoint.

	- of_graph_get_next_endpoint()
	+ of_graph_get_next_device_endpoint()

	- of_graph_get_endpoint_count()
	+ of_graph_get_device_endpoint_count()

	- for_each_endpoint_of_node()
	+ for_each_device_endpoint_of_node()


[PATCH 01/24] - [PATCH 02/24] : tidyup existing endpoint function kerneldoc
[PATCH 03/24] - [PATCH 11/24] : replace existing function to *_device_*
[PATCH 12/24] - [PATCH 24/24] : add new function and use it

v2 -> v3
	- tidyup existing endpoint function kerneldoc
	- replace exising function to *_device_*

v1 -> v2
	- tidyup function explain
	- add missing header on each files

https://lore.kernel.org/r/87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com
https://lore.kernel.org/r/87fryhklhb.wl-kuninori.morimoto.gx@renesas.com


Kuninori Morimoto (24):
   1) of: property: add missing kerneldoc for of_graph_get_endpoint_count()
   2) of: property: use unsigned int return on of_graph_get_endpoint_count()
   3) of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint()
   4) video: fbdev: switch to use of_graph_get_next_device_endpoint()
   5) media: i2c: switch to use of_graph_get_next_device_endpoint()
   6) media: platform: switch to use of_graph_get_next_device_endpoint()
   7) gpu: drm: switch to use of_graph_get_next_device_endpoint()
   8) hwtracing: switch to use of_graph_get_next_device_endpoint()
   9) staging: switch to use of_graph_get_next_device_endpoint()
  10) ASoC: switch to use of_graph_get_next_device_endpoint()
  11) of: remove of_graph_get_next_endpoint() define
  12) of: property: add port base loop
  13) of: property: use of_graph_get_next_port() on of_graph_get_next_endpoint()
  14) of: property: add of_graph_get_next_endpoint()
  15) drm: omapdrm: use of_graph_get_next_endpoint()
  16) media: xilinx-tpg: use of_graph_get_next_endpoint()
  17) ASoC: audio-graph-card: use of_graph_get_next_endpoint()
  18) ASoC: audio-graph-card2: use of_graph_get_next_port()
  19) ASoC: audio-graph-card2: use of_graph_get_next_endpoint()
  20) ASoC: test-component: use for_each_port_of_node()
  21) fbdev: omapfb: use of_graph_get_remote_port()
  22) fbdev: omapfb: use of_graph_get_next_port()
  23) fbdev: omapfb: use of_graph_get_next_endpoint()
  24) fbdev: omapfb: use of_graph_get_next_device_endpoint()

 .clang-format                                 |   2 +-
 drivers/gpu/drm/armada/armada_drv.c           |   2 +-
 drivers/gpu/drm/bridge/tc358767.c             |   2 +-
 drivers/gpu/drm/drm_of.c                      |   6 +-
 drivers/gpu/drm/meson/meson_drv.c             |   4 +-
 drivers/gpu/drm/msm/msm_drv.c                 |   2 +-
 drivers/gpu/drm/mxsfb/lcdif_drv.c             |   2 +-
 drivers/gpu/drm/omapdrm/dss/base.c            |   2 +-
 drivers/gpu/drm/omapdrm/dss/dpi.c             |   2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c             |   2 +-
 .../drm/panel/panel-raspberrypi-touchscreen.c |   2 +-
 drivers/gpu/drm/pl111/pl111_drv.c             |   2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c |   2 +-
 drivers/gpu/drm/stm/ltdc.c                    |   4 +-
 drivers/gpu/drm/tiny/arcpgu.c                 |   2 +-
 .../hwtracing/coresight/coresight-platform.c  |   4 +-
 drivers/media/i2c/adv7343.c                   |   2 +-
 drivers/media/i2c/adv748x/adv748x-core.c      |   2 +-
 drivers/media/i2c/adv7604.c                   |   2 +-
 drivers/media/i2c/isl7998x.c                  |   2 +-
 drivers/media/i2c/max9286.c                   |   2 +-
 drivers/media/i2c/mt9p031.c                   |   2 +-
 drivers/media/i2c/mt9v032.c                   |   2 +-
 drivers/media/i2c/ov2659.c                    |   2 +-
 drivers/media/i2c/ov5645.c                    |   2 +-
 drivers/media/i2c/ov5647.c                    |   2 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c      |   2 +-
 drivers/media/i2c/s5k5baf.c                   |   2 +-
 drivers/media/i2c/tc358743.c                  |   2 +-
 drivers/media/i2c/tda1997x.c                  |   2 +-
 drivers/media/i2c/tvp514x.c                   |   2 +-
 drivers/media/i2c/tvp5150.c                   |   4 +-
 drivers/media/i2c/tvp7002.c                   |   2 +-
 drivers/media/platform/atmel/atmel-isi.c      |   4 +-
 drivers/media/platform/intel/pxa_camera.c     |   2 +-
 .../microchip/microchip-sama5d2-isc.c         |   2 +-
 .../microchip/microchip-sama7g5-isc.c         |   2 +-
 drivers/media/platform/qcom/camss/camss.c     |   2 +-
 drivers/media/platform/renesas/renesas-ceu.c  |   2 +-
 .../platform/samsung/exynos4-is/fimc-is.c     |   2 +-
 .../platform/samsung/exynos4-is/mipi-csis.c   |   2 +-
 drivers/media/platform/st/stm32/stm32-dcmi.c  |   4 +-
 .../media/platform/ti/am437x/am437x-vpfe.c    |   2 +-
 drivers/media/platform/ti/davinci/vpif.c      |   3 +-
 .../media/platform/ti/davinci/vpif_capture.c  |   3 +-
 drivers/media/platform/video-mux.c            |   2 +-
 drivers/media/platform/xilinx/xilinx-tpg.c    |   3 +-
 drivers/media/platform/xilinx/xilinx-vipp.c   |   2 +-
 drivers/of/property.c                         | 126 ++++++++++++++----
 .../deprecated/atmel/atmel-sama5d2-isc.c      |   2 +-
 .../deprecated/atmel/atmel-sama7g5-isc.c      |   2 +-
 drivers/staging/media/tegra-video/csi.c       |   2 +-
 drivers/staging/media/tegra-video/vi.c        |   2 +-
 drivers/staging/media/tegra-video/vip.c       |   2 +-
 drivers/video/fbdev/amba-clcd.c               |   2 +-
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 101 +-------------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |   9 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c  |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c  |   3 +-
 .../omap2/omapfb/dss/omapdss-boot-init.c      |   2 +-
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |   3 +-
 drivers/video/fbdev/omap2/omapfb/dss/venc.c   |   3 +-
 drivers/video/fbdev/pxafb.c                   |   2 +-
 include/linux/of_graph.h                      |  51 +++++--
 include/video/omapfb_dss.h                    |  11 --
 sound/soc/codecs/ak4613.c                     |   2 +-
 sound/soc/generic/audio-graph-card.c          |   2 +-
 sound/soc/generic/audio-graph-card2.c         |  33 ++---
 sound/soc/generic/simple-card-utils.c         |   6 +-
 sound/soc/generic/test-component.c            |   4 +-
 sound/soc/sh/rcar/core.c                      |   4 +-
 73 files changed, 247 insertions(+), 251 deletions(-)

-- 
2.25.1


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

* [PATCH v3 01/24] of: property: add missing kerneldoc for of_graph_get_endpoint_count()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:04   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:04 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_endpoint_count() doesn't have kerneldoc. Add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index afdaefbd03f6..4e879faa1710 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -811,6 +811,12 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 }
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
+/**
+ * of_graph_get_endpoint_count() - get count of endpoint
+ * @np: pointer to the parent device node
+ *
+ * Return: count of endpoint of this device node
+ */
 int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
-- 
2.25.1


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

* [PATCH v3 01/24] of: property: add missing kerneldoc for of_graph_get_endpoint_count()
@ 2024-01-31  5:04   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:04 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_endpoint_count() doesn't have kerneldoc. Add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index afdaefbd03f6..4e879faa1710 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -811,6 +811,12 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 }
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
+/**
+ * of_graph_get_endpoint_count() - get count of endpoint
+ * @np: pointer to the parent device node
+ *
+ * Return: count of endpoint of this device node
+ */
 int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
-- 
2.25.1


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

* [PATCH v3 01/24] of: property: add missing kerneldoc for of_graph_get_endpoint_count()
@ 2024-01-31  5:04   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:04 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_endpoint_count() doesn't have kerneldoc. Add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index afdaefbd03f6..4e879faa1710 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -811,6 +811,12 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 }
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
+/**
+ * of_graph_get_endpoint_count() - get count of endpoint
+ * @np: pointer to the parent device node
+ *
+ * Return: count of endpoint of this device node
+ */
 int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

The return type and the variable of of_graph_get_endpoint_count()
should be unsigned. Tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 2 +-
 include/linux/of_graph.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 4e879faa1710..25d73409aeee 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -817,7 +817,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port);
  *
  * Return: count of endpoint of this device node
  */
-int of_graph_get_endpoint_count(const struct device_node *np)
+unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
 	int num = 0;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 4d7756087b6b..a4bea62bfa29 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -41,7 +41,7 @@ struct of_endpoint {
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
-int of_graph_get_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_endpoint_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 					struct device_node *previous);
@@ -68,7 +68,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-static inline int of_graph_get_endpoint_count(const struct device_node *np)
+static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	return 0;
 }
-- 
2.25.1


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

* [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

The return type and the variable of of_graph_get_endpoint_count()
should be unsigned. Tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 2 +-
 include/linux/of_graph.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 4e879faa1710..25d73409aeee 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -817,7 +817,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port);
  *
  * Return: count of endpoint of this device node
  */
-int of_graph_get_endpoint_count(const struct device_node *np)
+unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
 	int num = 0;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 4d7756087b6b..a4bea62bfa29 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -41,7 +41,7 @@ struct of_endpoint {
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
-int of_graph_get_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_endpoint_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 					struct device_node *previous);
@@ -68,7 +68,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-static inline int of_graph_get_endpoint_count(const struct device_node *np)
+static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	return 0;
 }
-- 
2.25.1


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

* [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

The return type and the variable of of_graph_get_endpoint_count()
should be unsigned. Tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 2 +-
 include/linux/of_graph.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 4e879faa1710..25d73409aeee 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -817,7 +817,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port);
  *
  * Return: count of endpoint of this device node
  */
-int of_graph_get_endpoint_count(const struct device_node *np)
+unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
 	int num = 0;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 4d7756087b6b..a4bea62bfa29 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -41,7 +41,7 @@ struct of_endpoint {
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
-int of_graph_get_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_endpoint_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 					struct device_node *previous);
@@ -68,7 +68,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-static inline int of_graph_get_endpoint_count(const struct device_node *np)
+static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
 {
 	return 0;
 }
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 03/24] of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Current of_graph_get_next_endpoint() will get next endpoint.

	ports {
		port@0 {
			endpoint@0 {...};
(A)			endpoint@1 {...};
		};
		port@1 {
(B)			endpoint {...};
		};
		...
	};

If it reached to end of port (A), it will get next endpoint from next
port (B). This behavior is not intuitive to user. User assume it return
NULL after (A) from this function name.

This function gets "endpoint" from "device" one after another instead
of "port". So let's rename related functions as

of_graph_get_next_endpoint()  -> of_graph_get_next_device_endpoint()
of_graph_get_endpoint_count() -> of_graph_get_device_endpoint_count()
for_each_endpoint_of_node()   -> for_each_device_endpoint_of_node()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .clang-format            |  2 +-
 drivers/of/property.c    | 24 +++++++++++++-----------
 include/linux/of_graph.h | 23 ++++++++++++++---------
 3 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/.clang-format b/.clang-format
index 0bbb1991defe..e8ca6d577073 100644
--- a/.clang-format
+++ b/.clang-format
@@ -231,6 +231,7 @@ ForEachMacros:
   - 'for_each_dedup_cand'
   - 'for_each_dev_addr'
   - 'for_each_dev_scope'
+  - 'for_each_device_endpoint_of_node'
   - 'for_each_dma_cap_mask'
   - 'for_each_dpcm_be'
   - 'for_each_dpcm_be_rollback'
@@ -243,7 +244,6 @@ ForEachMacros:
   - 'for_each_element'
   - 'for_each_element_extid'
   - 'for_each_element_id'
-  - 'for_each_endpoint_of_node'
   - 'for_each_event'
   - 'for_each_event_tps'
   - 'for_each_evictable_lru'
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 25d73409aeee..007729d66972 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -632,15 +632,17 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
 EXPORT_SYMBOL(of_graph_get_port_by_id);
 
 /**
- * of_graph_get_next_endpoint() - get next endpoint node
+ * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
+ * it gets next endpoint from next port.
+ *
  * @parent: pointer to the parent device node
  * @prev: previous endpoint node, or NULL to get first
  *
  * Return: An 'endpoint' node pointer with refcount incremented. Refcount
  * of the passed @prev node is decremented.
  */
-struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
-					struct device_node *prev)
+struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
+						      struct device_node *prev)
 {
 	struct device_node *endpoint;
 	struct device_node *port;
@@ -696,7 +698,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 		} while (!of_node_name_eq(port, "port"));
 	}
 }
-EXPORT_SYMBOL(of_graph_get_next_endpoint);
+EXPORT_SYMBOL(of_graph_get_next_device_endpoint);
 
 /**
  * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers
@@ -714,7 +716,7 @@ struct device_node *of_graph_get_endpoint_by_regs(
 	struct of_endpoint endpoint;
 	struct device_node *node = NULL;
 
-	for_each_endpoint_of_node(parent, node) {
+	for_each_device_endpoint_of_node(parent, node) {
 		of_graph_parse_endpoint(node, &endpoint);
 		if (((port_reg == -1) || (endpoint.port == port_reg)) &&
 			((reg == -1) || (endpoint.id == reg)))
@@ -812,22 +814,22 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
 /**
- * of_graph_get_endpoint_count() - get count of endpoint
+ * of_graph_get_device_endpoint_count() - get count of endpoint
  * @np: pointer to the parent device node
  *
  * Return: count of endpoint of this device node
  */
-unsigned int of_graph_get_endpoint_count(const struct device_node *np)
+unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
 	int num = 0;
 
-	for_each_endpoint_of_node(np, endpoint)
+	for_each_device_endpoint_of_node(np, endpoint)
 		num++;
 
 	return num;
 }
-EXPORT_SYMBOL(of_graph_get_endpoint_count);
+EXPORT_SYMBOL(of_graph_get_device_endpoint_count);
 
 /**
  * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
@@ -1017,8 +1019,8 @@ static struct fwnode_handle *
 of_fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
 				  struct fwnode_handle *prev)
 {
-	return of_fwnode_handle(of_graph_get_next_endpoint(to_of_node(fwnode),
-							   to_of_node(prev)));
+	return of_fwnode_handle(of_graph_get_next_device_endpoint(to_of_node(fwnode),
+								  to_of_node(prev)));
 }
 
 static struct fwnode_handle *
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index a4bea62bfa29..80b7a579e96a 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -26,25 +26,30 @@ struct of_endpoint {
 	const struct device_node *local_node;
 };
 
+/* REMOVE ME */
+#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous)
+#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child)
+#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np)
+
 /**
- * for_each_endpoint_of_node - iterate over every endpoint in a device node
+ * for_each_device_endpoint_of_node - iterate over every endpoint in a device node
  * @parent: parent device node containing ports and endpoints
  * @child: loop variable pointing to the current endpoint node
  *
  * When breaking out of the loop, of_node_put(child) has to be called manually.
  */
-#define for_each_endpoint_of_node(parent, child) \
-	for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \
-	     child = of_graph_get_next_endpoint(parent, child))
+#define for_each_device_endpoint_of_node(parent, child) \
+	for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \
+	     child = of_graph_get_next_device_endpoint(parent, child))
 
 #ifdef CONFIG_OF
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
-unsigned int of_graph_get_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_device_endpoint_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
-struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
-					struct device_node *previous);
+struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
+						      struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
 struct device_node *of_graph_get_remote_endpoint(
@@ -68,7 +73,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
+static inline unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 {
 	return 0;
 }
@@ -79,7 +84,7 @@ static inline struct device_node *of_graph_get_port_by_id(
 	return NULL;
 }
 
-static inline struct device_node *of_graph_get_next_endpoint(
+static inline struct device_node *of_graph_get_next_device_endpoint(
 					const struct device_node *parent,
 					struct device_node *previous)
 {
-- 
2.25.1


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

* [PATCH v3 03/24] of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

Current of_graph_get_next_endpoint() will get next endpoint.

	ports {
		port@0 {
			endpoint@0 {...};
(A)			endpoint@1 {...};
		};
		port@1 {
(B)			endpoint {...};
		};
		...
	};

If it reached to end of port (A), it will get next endpoint from next
port (B). This behavior is not intuitive to user. User assume it return
NULL after (A) from this function name.

This function gets "endpoint" from "device" one after another instead
of "port". So let's rename related functions as

of_graph_get_next_endpoint()  -> of_graph_get_next_device_endpoint()
of_graph_get_endpoint_count() -> of_graph_get_device_endpoint_count()
for_each_endpoint_of_node()   -> for_each_device_endpoint_of_node()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .clang-format            |  2 +-
 drivers/of/property.c    | 24 +++++++++++++-----------
 include/linux/of_graph.h | 23 ++++++++++++++---------
 3 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/.clang-format b/.clang-format
index 0bbb1991defe..e8ca6d577073 100644
--- a/.clang-format
+++ b/.clang-format
@@ -231,6 +231,7 @@ ForEachMacros:
   - 'for_each_dedup_cand'
   - 'for_each_dev_addr'
   - 'for_each_dev_scope'
+  - 'for_each_device_endpoint_of_node'
   - 'for_each_dma_cap_mask'
   - 'for_each_dpcm_be'
   - 'for_each_dpcm_be_rollback'
@@ -243,7 +244,6 @@ ForEachMacros:
   - 'for_each_element'
   - 'for_each_element_extid'
   - 'for_each_element_id'
-  - 'for_each_endpoint_of_node'
   - 'for_each_event'
   - 'for_each_event_tps'
   - 'for_each_evictable_lru'
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 25d73409aeee..007729d66972 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -632,15 +632,17 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
 EXPORT_SYMBOL(of_graph_get_port_by_id);
 
 /**
- * of_graph_get_next_endpoint() - get next endpoint node
+ * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
+ * it gets next endpoint from next port.
+ *
  * @parent: pointer to the parent device node
  * @prev: previous endpoint node, or NULL to get first
  *
  * Return: An 'endpoint' node pointer with refcount incremented. Refcount
  * of the passed @prev node is decremented.
  */
-struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
-					struct device_node *prev)
+struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
+						      struct device_node *prev)
 {
 	struct device_node *endpoint;
 	struct device_node *port;
@@ -696,7 +698,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 		} while (!of_node_name_eq(port, "port"));
 	}
 }
-EXPORT_SYMBOL(of_graph_get_next_endpoint);
+EXPORT_SYMBOL(of_graph_get_next_device_endpoint);
 
 /**
  * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers
@@ -714,7 +716,7 @@ struct device_node *of_graph_get_endpoint_by_regs(
 	struct of_endpoint endpoint;
 	struct device_node *node = NULL;
 
-	for_each_endpoint_of_node(parent, node) {
+	for_each_device_endpoint_of_node(parent, node) {
 		of_graph_parse_endpoint(node, &endpoint);
 		if (((port_reg == -1) || (endpoint.port == port_reg)) &&
 			((reg == -1) || (endpoint.id == reg)))
@@ -812,22 +814,22 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
 /**
- * of_graph_get_endpoint_count() - get count of endpoint
+ * of_graph_get_device_endpoint_count() - get count of endpoint
  * @np: pointer to the parent device node
  *
  * Return: count of endpoint of this device node
  */
-unsigned int of_graph_get_endpoint_count(const struct device_node *np)
+unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
 	int num = 0;
 
-	for_each_endpoint_of_node(np, endpoint)
+	for_each_device_endpoint_of_node(np, endpoint)
 		num++;
 
 	return num;
 }
-EXPORT_SYMBOL(of_graph_get_endpoint_count);
+EXPORT_SYMBOL(of_graph_get_device_endpoint_count);
 
 /**
  * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
@@ -1017,8 +1019,8 @@ static struct fwnode_handle *
 of_fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
 				  struct fwnode_handle *prev)
 {
-	return of_fwnode_handle(of_graph_get_next_endpoint(to_of_node(fwnode),
-							   to_of_node(prev)));
+	return of_fwnode_handle(of_graph_get_next_device_endpoint(to_of_node(fwnode),
+								  to_of_node(prev)));
 }
 
 static struct fwnode_handle *
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index a4bea62bfa29..80b7a579e96a 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -26,25 +26,30 @@ struct of_endpoint {
 	const struct device_node *local_node;
 };
 
+/* REMOVE ME */
+#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous)
+#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child)
+#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np)
+
 /**
- * for_each_endpoint_of_node - iterate over every endpoint in a device node
+ * for_each_device_endpoint_of_node - iterate over every endpoint in a device node
  * @parent: parent device node containing ports and endpoints
  * @child: loop variable pointing to the current endpoint node
  *
  * When breaking out of the loop, of_node_put(child) has to be called manually.
  */
-#define for_each_endpoint_of_node(parent, child) \
-	for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \
-	     child = of_graph_get_next_endpoint(parent, child))
+#define for_each_device_endpoint_of_node(parent, child) \
+	for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \
+	     child = of_graph_get_next_device_endpoint(parent, child))
 
 #ifdef CONFIG_OF
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
-unsigned int of_graph_get_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_device_endpoint_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
-struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
-					struct device_node *previous);
+struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
+						      struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
 struct device_node *of_graph_get_remote_endpoint(
@@ -68,7 +73,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
+static inline unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 {
 	return 0;
 }
@@ -79,7 +84,7 @@ static inline struct device_node *of_graph_get_port_by_id(
 	return NULL;
 }
 
-static inline struct device_node *of_graph_get_next_endpoint(
+static inline struct device_node *of_graph_get_next_device_endpoint(
 					const struct device_node *parent,
 					struct device_node *previous)
 {
-- 
2.25.1


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

* [PATCH v3 03/24] of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Current of_graph_get_next_endpoint() will get next endpoint.

	ports {
		port@0 {
			endpoint@0 {...};
(A)			endpoint@1 {...};
		};
		port@1 {
(B)			endpoint {...};
		};
		...
	};

If it reached to end of port (A), it will get next endpoint from next
port (B). This behavior is not intuitive to user. User assume it return
NULL after (A) from this function name.

This function gets "endpoint" from "device" one after another instead
of "port". So let's rename related functions as

of_graph_get_next_endpoint()  -> of_graph_get_next_device_endpoint()
of_graph_get_endpoint_count() -> of_graph_get_device_endpoint_count()
for_each_endpoint_of_node()   -> for_each_device_endpoint_of_node()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 .clang-format            |  2 +-
 drivers/of/property.c    | 24 +++++++++++++-----------
 include/linux/of_graph.h | 23 ++++++++++++++---------
 3 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/.clang-format b/.clang-format
index 0bbb1991defe..e8ca6d577073 100644
--- a/.clang-format
+++ b/.clang-format
@@ -231,6 +231,7 @@ ForEachMacros:
   - 'for_each_dedup_cand'
   - 'for_each_dev_addr'
   - 'for_each_dev_scope'
+  - 'for_each_device_endpoint_of_node'
   - 'for_each_dma_cap_mask'
   - 'for_each_dpcm_be'
   - 'for_each_dpcm_be_rollback'
@@ -243,7 +244,6 @@ ForEachMacros:
   - 'for_each_element'
   - 'for_each_element_extid'
   - 'for_each_element_id'
-  - 'for_each_endpoint_of_node'
   - 'for_each_event'
   - 'for_each_event_tps'
   - 'for_each_evictable_lru'
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 25d73409aeee..007729d66972 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -632,15 +632,17 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
 EXPORT_SYMBOL(of_graph_get_port_by_id);
 
 /**
- * of_graph_get_next_endpoint() - get next endpoint node
+ * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
+ * it gets next endpoint from next port.
+ *
  * @parent: pointer to the parent device node
  * @prev: previous endpoint node, or NULL to get first
  *
  * Return: An 'endpoint' node pointer with refcount incremented. Refcount
  * of the passed @prev node is decremented.
  */
-struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
-					struct device_node *prev)
+struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
+						      struct device_node *prev)
 {
 	struct device_node *endpoint;
 	struct device_node *port;
@@ -696,7 +698,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
 		} while (!of_node_name_eq(port, "port"));
 	}
 }
-EXPORT_SYMBOL(of_graph_get_next_endpoint);
+EXPORT_SYMBOL(of_graph_get_next_device_endpoint);
 
 /**
  * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers
@@ -714,7 +716,7 @@ struct device_node *of_graph_get_endpoint_by_regs(
 	struct of_endpoint endpoint;
 	struct device_node *node = NULL;
 
-	for_each_endpoint_of_node(parent, node) {
+	for_each_device_endpoint_of_node(parent, node) {
 		of_graph_parse_endpoint(node, &endpoint);
 		if (((port_reg == -1) || (endpoint.port == port_reg)) &&
 			((reg == -1) || (endpoint.id == reg)))
@@ -812,22 +814,22 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node)
 EXPORT_SYMBOL(of_graph_get_remote_port);
 
 /**
- * of_graph_get_endpoint_count() - get count of endpoint
+ * of_graph_get_device_endpoint_count() - get count of endpoint
  * @np: pointer to the parent device node
  *
  * Return: count of endpoint of this device node
  */
-unsigned int of_graph_get_endpoint_count(const struct device_node *np)
+unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 {
 	struct device_node *endpoint;
 	int num = 0;
 
-	for_each_endpoint_of_node(np, endpoint)
+	for_each_device_endpoint_of_node(np, endpoint)
 		num++;
 
 	return num;
 }
-EXPORT_SYMBOL(of_graph_get_endpoint_count);
+EXPORT_SYMBOL(of_graph_get_device_endpoint_count);
 
 /**
  * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
@@ -1017,8 +1019,8 @@ static struct fwnode_handle *
 of_fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
 				  struct fwnode_handle *prev)
 {
-	return of_fwnode_handle(of_graph_get_next_endpoint(to_of_node(fwnode),
-							   to_of_node(prev)));
+	return of_fwnode_handle(of_graph_get_next_device_endpoint(to_of_node(fwnode),
+								  to_of_node(prev)));
 }
 
 static struct fwnode_handle *
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index a4bea62bfa29..80b7a579e96a 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -26,25 +26,30 @@ struct of_endpoint {
 	const struct device_node *local_node;
 };
 
+/* REMOVE ME */
+#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous)
+#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child)
+#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np)
+
 /**
- * for_each_endpoint_of_node - iterate over every endpoint in a device node
+ * for_each_device_endpoint_of_node - iterate over every endpoint in a device node
  * @parent: parent device node containing ports and endpoints
  * @child: loop variable pointing to the current endpoint node
  *
  * When breaking out of the loop, of_node_put(child) has to be called manually.
  */
-#define for_each_endpoint_of_node(parent, child) \
-	for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \
-	     child = of_graph_get_next_endpoint(parent, child))
+#define for_each_device_endpoint_of_node(parent, child) \
+	for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \
+	     child = of_graph_get_next_device_endpoint(parent, child))
 
 #ifdef CONFIG_OF
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
-unsigned int of_graph_get_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_device_endpoint_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
-struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
-					struct device_node *previous);
+struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
+						      struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
 struct device_node *of_graph_get_remote_endpoint(
@@ -68,7 +73,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
 	return -ENOSYS;
 }
 
-static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
+static inline unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 {
 	return 0;
 }
@@ -79,7 +84,7 @@ static inline struct device_node *of_graph_get_port_by_id(
 	return NULL;
 }
 
-static inline struct device_node *of_graph_get_next_endpoint(
+static inline struct device_node *of_graph_get_next_device_endpoint(
 					const struct device_node *parent,
 					struct device_node *previous)
 {
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 04/24] video: fbdev: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/amba-clcd.c                          | 2 +-
 drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 +-
 drivers/video/fbdev/pxafb.c                              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 0399db369e70..7778c4a6b294 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -691,7 +691,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
 	/*
 	 * Fetch the panel endpoint.
 	 */
-	endpoint = of_graph_get_next_endpoint(fb->dev->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(fb->dev->dev.of_node, NULL);
 	if (!endpoint)
 		return -ENODEV;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
index 09f719af0d0c..a5da79214061 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
@@ -150,7 +150,7 @@ static void __init omapdss_walk_device(struct device_node *node, bool root)
 	of_node_put(n);
 
 	n = NULL;
-	while ((n = of_graph_get_next_endpoint(node, n)) != NULL) {
+	while ((n = of_graph_get_next_device_endpoint(node, n)) != NULL) {
 		struct device_node *pn;
 
 		pn = of_graph_get_remote_port_parent(n);
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index fa943612c4e2..0acdde8b2f45 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2171,7 +2171,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
 	u32 bus_width;
 	int ret, i;
 
-	np = of_graph_get_next_endpoint(dev->of_node, NULL);
+	np = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!np) {
 		dev_err(dev, "could not find endpoint\n");
 		return -EINVAL;
-- 
2.25.1


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

* [PATCH v3 04/24] video: fbdev: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/amba-clcd.c                          | 2 +-
 drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 +-
 drivers/video/fbdev/pxafb.c                              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 0399db369e70..7778c4a6b294 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -691,7 +691,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
 	/*
 	 * Fetch the panel endpoint.
 	 */
-	endpoint = of_graph_get_next_endpoint(fb->dev->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(fb->dev->dev.of_node, NULL);
 	if (!endpoint)
 		return -ENODEV;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
index 09f719af0d0c..a5da79214061 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
@@ -150,7 +150,7 @@ static void __init omapdss_walk_device(struct device_node *node, bool root)
 	of_node_put(n);
 
 	n = NULL;
-	while ((n = of_graph_get_next_endpoint(node, n)) != NULL) {
+	while ((n = of_graph_get_next_device_endpoint(node, n)) != NULL) {
 		struct device_node *pn;
 
 		pn = of_graph_get_remote_port_parent(n);
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index fa943612c4e2..0acdde8b2f45 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2171,7 +2171,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
 	u32 bus_width;
 	int ret, i;
 
-	np = of_graph_get_next_endpoint(dev->of_node, NULL);
+	np = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!np) {
 		dev_err(dev, "could not find endpoint\n");
 		return -EINVAL;
-- 
2.25.1


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

* [PATCH v3 04/24] video: fbdev: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/amba-clcd.c                          | 2 +-
 drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 +-
 drivers/video/fbdev/pxafb.c                              | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
index 0399db369e70..7778c4a6b294 100644
--- a/drivers/video/fbdev/amba-clcd.c
+++ b/drivers/video/fbdev/amba-clcd.c
@@ -691,7 +691,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb)
 	/*
 	 * Fetch the panel endpoint.
 	 */
-	endpoint = of_graph_get_next_endpoint(fb->dev->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(fb->dev->dev.of_node, NULL);
 	if (!endpoint)
 		return -ENODEV;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
index 09f719af0d0c..a5da79214061 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c
@@ -150,7 +150,7 @@ static void __init omapdss_walk_device(struct device_node *node, bool root)
 	of_node_put(n);
 
 	n = NULL;
-	while ((n = of_graph_get_next_endpoint(node, n)) != NULL) {
+	while ((n = of_graph_get_next_device_endpoint(node, n)) != NULL) {
 		struct device_node *pn;
 
 		pn = of_graph_get_remote_port_parent(n);
diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index fa943612c4e2..0acdde8b2f45 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2171,7 +2171,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
 	u32 bus_width;
 	int ret, i;
 
-	np = of_graph_get_next_endpoint(dev->of_node, NULL);
+	np = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!np) {
 		dev_err(dev, "could not find endpoint\n");
 		return -EINVAL;
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/i2c/adv7343.c              | 2 +-
 drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
 drivers/media/i2c/adv7604.c              | 2 +-
 drivers/media/i2c/isl7998x.c             | 2 +-
 drivers/media/i2c/max9286.c              | 2 +-
 drivers/media/i2c/mt9p031.c              | 2 +-
 drivers/media/i2c/mt9v032.c              | 2 +-
 drivers/media/i2c/ov2659.c               | 2 +-
 drivers/media/i2c/ov5645.c               | 2 +-
 drivers/media/i2c/ov5647.c               | 2 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
 drivers/media/i2c/s5k5baf.c              | 2 +-
 drivers/media/i2c/tc358743.c             | 2 +-
 drivers/media/i2c/tda1997x.c             | 2 +-
 drivers/media/i2c/tvp514x.c              | 2 +-
 drivers/media/i2c/tvp5150.c              | 4 ++--
 drivers/media/i2c/tvp7002.c              | 2 +-
 17 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index ff21cd4744d3..7e4eb2f8bf0d 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index 3eb6d5e8f082..4e9e4cef8954 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -657,7 +657,7 @@ static int adv748x_parse_dt(struct adv748x_state *state)
 	bool in_found = false;
 	int ret;
 
-	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
+	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
 		of_graph_parse_endpoint(ep_np, &ep);
 		adv_info(state, "Endpoint %pOF on port %d", ep.local_node,
 			 ep.port);
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index b202a85fbeaa..5b98a688b5de 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3205,7 +3205,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
 
 	/* Parse the endpoint. */
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	endpoint = of_graph_get_next_device_endpoint(np, NULL);
 	if (!endpoint)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
index 73460688c356..1ef26dd8290c 100644
--- a/drivers/media/i2c/isl7998x.c
+++ b/drivers/media/i2c/isl7998x.c
@@ -580,7 +580,7 @@ static int isl7998x_get_nr_inputs(struct device_node *of_node)
 	unsigned int inputs = 0;
 	unsigned int i;
 
-	if (of_graph_get_endpoint_count(of_node) > ISL7998X_NUM_PADS)
+	if (of_graph_get_device_endpoint_count(of_node) > ISL7998X_NUM_PADS)
 		return -EINVAL;
 
 	/*
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index fc1cf196ef01..7d0725285a24 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1452,7 +1452,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 	of_node_put(i2c_mux);
 
 	/* Parse the endpoints */
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		struct max9286_source *source;
 		struct of_endpoint ep;
 
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 348f1e1098fb..4832968ca50b 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -1080,7 +1080,7 @@ mt9p031_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index 1c6f6cea1204..236a671857a1 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -1008,7 +1008,7 @@ mt9v032_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 2c3dbe164eb6..a909edadc8d5 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1388,7 +1388,7 @@ ov2659_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index a70db7e601a4..cb04b2a71492 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -1053,7 +1053,7 @@ static int ov5645_probe(struct i2c_client *client)
 	ov5645->i2c_client = client;
 	ov5645->dev = dev;
 
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint) {
 		dev_err(dev, "endpoint node not found\n");
 		return -EINVAL;
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index dcfe3129c63a..2772195f15e0 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1363,7 +1363,7 @@ static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(np, NULL);
+	ep = of_graph_get_next_device_endpoint(np, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index ed5b10731a14..a43f5c8bf770 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1555,7 +1555,7 @@ static int s5c73m3_get_dt_data(struct s5c73m3 *state)
 				     "failed to request gpio S5C73M3_RST\n");
 	gpiod_set_consumer_name(state->reset, "S5C73M3_RST");
 
-	node_ep = of_graph_get_next_endpoint(node, NULL);
+	node_ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node_ep) {
 		dev_warn(dev, "no endpoint defined for node: %pOF\n", node);
 		return 0;
diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 67da2045f543..063b8ede4ffb 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -1836,7 +1836,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev)
 			 state->mclk_frequency);
 	}
 
-	node_ep = of_graph_get_next_endpoint(node, NULL);
+	node_ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node_ep) {
 		dev_err(dev, "no endpoint defined at node %pOF\n", node);
 		return -EINVAL;
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 2785935da497..9664fe1526e2 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1895,7 +1895,7 @@ static int tc358743_probe_of(struct tc358743_state *state)
 		return dev_err_probe(dev, PTR_ERR(refclk),
 				     "failed to get refclk\n");
 
-	ep = of_graph_get_next_endpoint(dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!ep) {
 		dev_err(dev, "missing endpoint node\n");
 		return -EINVAL;
diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 325e99125941..5b5379c7e56c 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -2307,7 +2307,7 @@ static int tda1997x_parse_dt(struct tda1997x_state *state)
 	pdata->vidout_sel_de = DE_FREF_SEL_DE_VHREF;
 
 	np = state->client->dev.of_node;
-	ep = of_graph_get_next_endpoint(np, NULL);
+	ep = of_graph_get_next_device_endpoint(np, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index c37f605cb75f..f979d95b3b21 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -988,7 +988,7 @@ tvp514x_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index e543b3f7a4d8..e8ad131fcd6b 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -2000,7 +2000,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 	int ret;
 
 	/* At least 1 output and 1 input */
-	ep_num = of_graph_get_endpoint_count(np);
+	ep_num = of_graph_get_device_endpoint_count(np);
 	if (ep_num < 2 || ep_num > 5) {
 		dev_err(dev, "At least 1 input and 1 output must be connected to the device.\n");
 		return -EINVAL;
@@ -2017,7 +2017,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 	 * tvp-5150 port@2
 	 *	endpoint (video bitstream output at YOUT[0-7] parallel bus)
 	 */
-	for_each_endpoint_of_node(np, ep_np) {
+	for_each_device_endpoint_of_node(np, ep_np) {
 		struct fwnode_handle *ep_fwnode = of_fwnode_handle(ep_np);
 		unsigned int next_connector = decoder->connectors_num;
 		struct of_endpoint ep;
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index a2d7bc799849..27f2a138bd09 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -893,7 +893,7 @@ tvp7002_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
-- 
2.25.1


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

* [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/i2c/adv7343.c              | 2 +-
 drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
 drivers/media/i2c/adv7604.c              | 2 +-
 drivers/media/i2c/isl7998x.c             | 2 +-
 drivers/media/i2c/max9286.c              | 2 +-
 drivers/media/i2c/mt9p031.c              | 2 +-
 drivers/media/i2c/mt9v032.c              | 2 +-
 drivers/media/i2c/ov2659.c               | 2 +-
 drivers/media/i2c/ov5645.c               | 2 +-
 drivers/media/i2c/ov5647.c               | 2 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
 drivers/media/i2c/s5k5baf.c              | 2 +-
 drivers/media/i2c/tc358743.c             | 2 +-
 drivers/media/i2c/tda1997x.c             | 2 +-
 drivers/media/i2c/tvp514x.c              | 2 +-
 drivers/media/i2c/tvp5150.c              | 4 ++--
 drivers/media/i2c/tvp7002.c              | 2 +-
 17 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index ff21cd4744d3..7e4eb2f8bf0d 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index 3eb6d5e8f082..4e9e4cef8954 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -657,7 +657,7 @@ static int adv748x_parse_dt(struct adv748x_state *state)
 	bool in_found = false;
 	int ret;
 
-	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
+	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
 		of_graph_parse_endpoint(ep_np, &ep);
 		adv_info(state, "Endpoint %pOF on port %d", ep.local_node,
 			 ep.port);
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index b202a85fbeaa..5b98a688b5de 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3205,7 +3205,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
 
 	/* Parse the endpoint. */
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	endpoint = of_graph_get_next_device_endpoint(np, NULL);
 	if (!endpoint)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
index 73460688c356..1ef26dd8290c 100644
--- a/drivers/media/i2c/isl7998x.c
+++ b/drivers/media/i2c/isl7998x.c
@@ -580,7 +580,7 @@ static int isl7998x_get_nr_inputs(struct device_node *of_node)
 	unsigned int inputs = 0;
 	unsigned int i;
 
-	if (of_graph_get_endpoint_count(of_node) > ISL7998X_NUM_PADS)
+	if (of_graph_get_device_endpoint_count(of_node) > ISL7998X_NUM_PADS)
 		return -EINVAL;
 
 	/*
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index fc1cf196ef01..7d0725285a24 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1452,7 +1452,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 	of_node_put(i2c_mux);
 
 	/* Parse the endpoints */
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		struct max9286_source *source;
 		struct of_endpoint ep;
 
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 348f1e1098fb..4832968ca50b 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -1080,7 +1080,7 @@ mt9p031_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index 1c6f6cea1204..236a671857a1 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -1008,7 +1008,7 @@ mt9v032_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 2c3dbe164eb6..a909edadc8d5 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1388,7 +1388,7 @@ ov2659_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index a70db7e601a4..cb04b2a71492 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -1053,7 +1053,7 @@ static int ov5645_probe(struct i2c_client *client)
 	ov5645->i2c_client = client;
 	ov5645->dev = dev;
 
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint) {
 		dev_err(dev, "endpoint node not found\n");
 		return -EINVAL;
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index dcfe3129c63a..2772195f15e0 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1363,7 +1363,7 @@ static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(np, NULL);
+	ep = of_graph_get_next_device_endpoint(np, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index ed5b10731a14..a43f5c8bf770 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1555,7 +1555,7 @@ static int s5c73m3_get_dt_data(struct s5c73m3 *state)
 				     "failed to request gpio S5C73M3_RST\n");
 	gpiod_set_consumer_name(state->reset, "S5C73M3_RST");
 
-	node_ep = of_graph_get_next_endpoint(node, NULL);
+	node_ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node_ep) {
 		dev_warn(dev, "no endpoint defined for node: %pOF\n", node);
 		return 0;
diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 67da2045f543..063b8ede4ffb 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -1836,7 +1836,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev)
 			 state->mclk_frequency);
 	}
 
-	node_ep = of_graph_get_next_endpoint(node, NULL);
+	node_ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node_ep) {
 		dev_err(dev, "no endpoint defined at node %pOF\n", node);
 		return -EINVAL;
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 2785935da497..9664fe1526e2 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1895,7 +1895,7 @@ static int tc358743_probe_of(struct tc358743_state *state)
 		return dev_err_probe(dev, PTR_ERR(refclk),
 				     "failed to get refclk\n");
 
-	ep = of_graph_get_next_endpoint(dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!ep) {
 		dev_err(dev, "missing endpoint node\n");
 		return -EINVAL;
diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 325e99125941..5b5379c7e56c 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -2307,7 +2307,7 @@ static int tda1997x_parse_dt(struct tda1997x_state *state)
 	pdata->vidout_sel_de = DE_FREF_SEL_DE_VHREF;
 
 	np = state->client->dev.of_node;
-	ep = of_graph_get_next_endpoint(np, NULL);
+	ep = of_graph_get_next_device_endpoint(np, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index c37f605cb75f..f979d95b3b21 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -988,7 +988,7 @@ tvp514x_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index e543b3f7a4d8..e8ad131fcd6b 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -2000,7 +2000,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 	int ret;
 
 	/* At least 1 output and 1 input */
-	ep_num = of_graph_get_endpoint_count(np);
+	ep_num = of_graph_get_device_endpoint_count(np);
 	if (ep_num < 2 || ep_num > 5) {
 		dev_err(dev, "At least 1 input and 1 output must be connected to the device.\n");
 		return -EINVAL;
@@ -2017,7 +2017,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 	 * tvp-5150 port@2
 	 *	endpoint (video bitstream output at YOUT[0-7] parallel bus)
 	 */
-	for_each_endpoint_of_node(np, ep_np) {
+	for_each_device_endpoint_of_node(np, ep_np) {
 		struct fwnode_handle *ep_fwnode = of_fwnode_handle(ep_np);
 		unsigned int next_connector = decoder->connectors_num;
 		struct of_endpoint ep;
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index a2d7bc799849..27f2a138bd09 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -893,7 +893,7 @@ tvp7002_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
-- 
2.25.1


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

* [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/i2c/adv7343.c              | 2 +-
 drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
 drivers/media/i2c/adv7604.c              | 2 +-
 drivers/media/i2c/isl7998x.c             | 2 +-
 drivers/media/i2c/max9286.c              | 2 +-
 drivers/media/i2c/mt9p031.c              | 2 +-
 drivers/media/i2c/mt9v032.c              | 2 +-
 drivers/media/i2c/ov2659.c               | 2 +-
 drivers/media/i2c/ov5645.c               | 2 +-
 drivers/media/i2c/ov5647.c               | 2 +-
 drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
 drivers/media/i2c/s5k5baf.c              | 2 +-
 drivers/media/i2c/tc358743.c             | 2 +-
 drivers/media/i2c/tda1997x.c             | 2 +-
 drivers/media/i2c/tvp514x.c              | 2 +-
 drivers/media/i2c/tvp5150.c              | 4 ++--
 drivers/media/i2c/tvp7002.c              | 2 +-
 17 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index ff21cd4744d3..7e4eb2f8bf0d 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index 3eb6d5e8f082..4e9e4cef8954 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -657,7 +657,7 @@ static int adv748x_parse_dt(struct adv748x_state *state)
 	bool in_found = false;
 	int ret;
 
-	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
+	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
 		of_graph_parse_endpoint(ep_np, &ep);
 		adv_info(state, "Endpoint %pOF on port %d", ep.local_node,
 			 ep.port);
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index b202a85fbeaa..5b98a688b5de 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -3205,7 +3205,7 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
 	np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node;
 
 	/* Parse the endpoint. */
-	endpoint = of_graph_get_next_endpoint(np, NULL);
+	endpoint = of_graph_get_next_device_endpoint(np, NULL);
 	if (!endpoint)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/isl7998x.c b/drivers/media/i2c/isl7998x.c
index 73460688c356..1ef26dd8290c 100644
--- a/drivers/media/i2c/isl7998x.c
+++ b/drivers/media/i2c/isl7998x.c
@@ -580,7 +580,7 @@ static int isl7998x_get_nr_inputs(struct device_node *of_node)
 	unsigned int inputs = 0;
 	unsigned int i;
 
-	if (of_graph_get_endpoint_count(of_node) > ISL7998X_NUM_PADS)
+	if (of_graph_get_device_endpoint_count(of_node) > ISL7998X_NUM_PADS)
 		return -EINVAL;
 
 	/*
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index fc1cf196ef01..7d0725285a24 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1452,7 +1452,7 @@ static int max9286_parse_dt(struct max9286_priv *priv)
 	of_node_put(i2c_mux);
 
 	/* Parse the endpoints */
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		struct max9286_source *source;
 		struct of_endpoint ep;
 
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 348f1e1098fb..4832968ca50b 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -1080,7 +1080,7 @@ mt9p031_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index 1c6f6cea1204..236a671857a1 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -1008,7 +1008,7 @@ mt9v032_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!np)
 		return NULL;
 
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 2c3dbe164eb6..a909edadc8d5 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1388,7 +1388,7 @@ ov2659_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index a70db7e601a4..cb04b2a71492 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -1053,7 +1053,7 @@ static int ov5645_probe(struct i2c_client *client)
 	ov5645->i2c_client = client;
 	ov5645->dev = dev;
 
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint) {
 		dev_err(dev, "endpoint node not found\n");
 		return -EINVAL;
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index dcfe3129c63a..2772195f15e0 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1363,7 +1363,7 @@ static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(np, NULL);
+	ep = of_graph_get_next_device_endpoint(np, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index ed5b10731a14..a43f5c8bf770 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1555,7 +1555,7 @@ static int s5c73m3_get_dt_data(struct s5c73m3 *state)
 				     "failed to request gpio S5C73M3_RST\n");
 	gpiod_set_consumer_name(state->reset, "S5C73M3_RST");
 
-	node_ep = of_graph_get_next_endpoint(node, NULL);
+	node_ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node_ep) {
 		dev_warn(dev, "no endpoint defined for node: %pOF\n", node);
 		return 0;
diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 67da2045f543..063b8ede4ffb 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -1836,7 +1836,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev)
 			 state->mclk_frequency);
 	}
 
-	node_ep = of_graph_get_next_endpoint(node, NULL);
+	node_ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node_ep) {
 		dev_err(dev, "no endpoint defined at node %pOF\n", node);
 		return -EINVAL;
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 2785935da497..9664fe1526e2 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1895,7 +1895,7 @@ static int tc358743_probe_of(struct tc358743_state *state)
 		return dev_err_probe(dev, PTR_ERR(refclk),
 				     "failed to get refclk\n");
 
-	ep = of_graph_get_next_endpoint(dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!ep) {
 		dev_err(dev, "missing endpoint node\n");
 		return -EINVAL;
diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 325e99125941..5b5379c7e56c 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -2307,7 +2307,7 @@ static int tda1997x_parse_dt(struct tda1997x_state *state)
 	pdata->vidout_sel_de = DE_FREF_SEL_DE_VHREF;
 
 	np = state->client->dev.of_node;
-	ep = of_graph_get_next_endpoint(np, NULL);
+	ep = of_graph_get_next_device_endpoint(np, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index c37f605cb75f..f979d95b3b21 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -988,7 +988,7 @@ tvp514x_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index e543b3f7a4d8..e8ad131fcd6b 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -2000,7 +2000,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 	int ret;
 
 	/* At least 1 output and 1 input */
-	ep_num = of_graph_get_endpoint_count(np);
+	ep_num = of_graph_get_device_endpoint_count(np);
 	if (ep_num < 2 || ep_num > 5) {
 		dev_err(dev, "At least 1 input and 1 output must be connected to the device.\n");
 		return -EINVAL;
@@ -2017,7 +2017,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 	 * tvp-5150 port@2
 	 *	endpoint (video bitstream output at YOUT[0-7] parallel bus)
 	 */
-	for_each_endpoint_of_node(np, ep_np) {
+	for_each_device_endpoint_of_node(np, ep_np) {
 		struct fwnode_handle *ep_fwnode = of_fwnode_handle(ep_np);
 		unsigned int next_connector = decoder->connectors_num;
 		struct of_endpoint ep;
diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index a2d7bc799849..27f2a138bd09 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -893,7 +893,7 @@ tvp7002_get_pdata(struct i2c_client *client)
 	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
 		return client->dev.platform_data;
 
-	endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);
 	if (!endpoint)
 		return NULL;
 
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 06/24] media: platform: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/platform/atmel/atmel-isi.c                 | 4 ++--
 drivers/media/platform/intel/pxa_camera.c                | 2 +-
 drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 +-
 drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 +-
 drivers/media/platform/qcom/camss/camss.c                | 2 +-
 drivers/media/platform/renesas/renesas-ceu.c             | 2 +-
 drivers/media/platform/samsung/exynos4-is/fimc-is.c      | 2 +-
 drivers/media/platform/samsung/exynos4-is/mipi-csis.c    | 2 +-
 drivers/media/platform/st/stm32/stm32-dcmi.c             | 4 ++--
 drivers/media/platform/ti/am437x/am437x-vpfe.c           | 2 +-
 drivers/media/platform/ti/davinci/vpif.c                 | 3 +--
 drivers/media/platform/ti/davinci/vpif_capture.c         | 3 +--
 drivers/media/platform/video-mux.c                       | 2 +-
 drivers/media/platform/xilinx/xilinx-vipp.c              | 2 +-
 14 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 4046212d48b4..4317750d05ad 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -831,7 +831,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
 	isi->pdata.full_mode = 1;
 	isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
 
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(&pdev->dev, "Could not find the endpoint\n");
 		return -EINVAL;
@@ -1155,7 +1155,7 @@ static int isi_graph_init(struct atmel_isi *isi)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(isi->dev->of_node, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c
index 59b89e421dc2..f2175c03502b 100644
--- a/drivers/media/platform/intel/pxa_camera.c
+++ b/drivers/media/platform/intel/pxa_camera.c
@@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
 		pcdev->mclk = mclk_rate;
 	}
 
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(dev, "could not find endpoint\n");
 		return -EINVAL;
diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
index 5ac149cf3647..201049c047b0 100644
--- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
@@ -363,7 +363,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
index 73445f33d26b..b617a9bcd398 100644
--- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
@@ -349,7 +349,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 8e78dd8d5961..cbb6f88cfe4a 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1136,7 +1136,7 @@ static int camss_of_parse_ports(struct camss *camss)
 	struct device_node *remote = NULL;
 	int ret, num_subdevs = 0;
 
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		struct camss_async_subdev *csd;
 
 		if (!of_device_is_available(node))
diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
index 2562b30acfb9..929d17de4ac9 100644
--- a/drivers/media/platform/renesas/renesas-ceu.c
+++ b/drivers/media/platform/renesas/renesas-ceu.c
@@ -1526,7 +1526,7 @@ static int ceu_parse_dt(struct ceu_device *ceudev)
 	int num_ep;
 	int ret;
 
-	num_ep = of_graph_get_endpoint_count(of);
+	num_ep = of_graph_get_device_endpoint_count(of);
 	if (!num_ep)
 		return -ENODEV;
 
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index a08c87ef6e2d..5ab0399b7718 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
 		return -EINVAL;
 	}
 
-	ep = of_graph_get_next_endpoint(node, NULL);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return -ENXIO;
 
diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
index 686ca8753ba2..a332b4bd76f2 100644
--- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
@@ -728,7 +728,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
 				 &state->max_num_lanes))
 		return -EINVAL;
 
-	node = of_graph_get_next_endpoint(node, NULL);
+	node = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node) {
 		dev_err(&pdev->dev, "No port node at %pOF\n",
 				pdev->dev.of_node);
diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 8cb4fdcae137..320101f4ad40 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -1856,7 +1856,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(dcmi->dev->of_node, NULL);
 	if (!ep) {
 		dev_err(dcmi->dev, "Failed to get next endpoint\n");
 		return -EINVAL;
@@ -1915,7 +1915,7 @@ static int dcmi_probe(struct platform_device *pdev)
 				     "Could not get reset control\n");
 
 	/* Get bus characteristics from devicetree */
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(&pdev->dev, "Could not find the endpoint\n");
 		return -ENODEV;
diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
index 5fa2ea9025d9..46876865ec6a 100644
--- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
@@ -2309,7 +2309,7 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
 		struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
 		struct device_node *rem;
 
-		endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint);
+		endpoint = of_graph_get_next_device_endpoint(dev->of_node, endpoint);
 		if (!endpoint)
 			break;
 
diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c
index 63cdfed37bc9..021ca79e832b 100644
--- a/drivers/media/platform/ti/davinci/vpif.c
+++ b/drivers/media/platform/ti/davinci/vpif.c
@@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev)
 	 * so their devices need to be registered manually here
 	 * for their legacy platform_drivers to work.
 	 */
-	endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
-					      endpoint);
+	endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
 	if (!endpoint)
 		return 0;
 	of_node_put(endpoint);
diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
index 99fae8830c41..805c313b41dc 100644
--- a/drivers/media/platform/ti/davinci/vpif_capture.c
+++ b/drivers/media/platform/ti/davinci/vpif_capture.c
@@ -1521,8 +1521,7 @@ vpif_capture_get_pdata(struct platform_device *pdev,
 		unsigned int flags;
 		int err;
 
-		endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
-						      endpoint);
+		endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
 		if (!endpoint)
 			break;
 
diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
index 5de6b6694f53..61d84ade7155 100644
--- a/drivers/media/platform/video-mux.c
+++ b/drivers/media/platform/video-mux.c
@@ -408,7 +408,7 @@ static int video_mux_probe(struct platform_device *pdev)
 	 * The largest numbered port is the output port. It determines
 	 * total number of pads.
 	 */
-	for_each_endpoint_of_node(np, ep) {
+	for_each_device_endpoint_of_node(np, ep) {
 		struct of_endpoint endpoint;
 
 		of_graph_parse_endpoint(ep, &endpoint);
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index 996684a73038..9230931d6d7a 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -207,7 +207,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
 
 	while (1) {
 		/* Get the next endpoint and parse its link. */
-		ep = of_graph_get_next_endpoint(node, ep);
+		ep = of_graph_get_next_device_endpoint(node, ep);
 		if (ep == NULL)
 			break;
 
-- 
2.25.1


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

* [PATCH v3 06/24] media: platform: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/platform/atmel/atmel-isi.c                 | 4 ++--
 drivers/media/platform/intel/pxa_camera.c                | 2 +-
 drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 +-
 drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 +-
 drivers/media/platform/qcom/camss/camss.c                | 2 +-
 drivers/media/platform/renesas/renesas-ceu.c             | 2 +-
 drivers/media/platform/samsung/exynos4-is/fimc-is.c      | 2 +-
 drivers/media/platform/samsung/exynos4-is/mipi-csis.c    | 2 +-
 drivers/media/platform/st/stm32/stm32-dcmi.c             | 4 ++--
 drivers/media/platform/ti/am437x/am437x-vpfe.c           | 2 +-
 drivers/media/platform/ti/davinci/vpif.c                 | 3 +--
 drivers/media/platform/ti/davinci/vpif_capture.c         | 3 +--
 drivers/media/platform/video-mux.c                       | 2 +-
 drivers/media/platform/xilinx/xilinx-vipp.c              | 2 +-
 14 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 4046212d48b4..4317750d05ad 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -831,7 +831,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
 	isi->pdata.full_mode = 1;
 	isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
 
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(&pdev->dev, "Could not find the endpoint\n");
 		return -EINVAL;
@@ -1155,7 +1155,7 @@ static int isi_graph_init(struct atmel_isi *isi)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(isi->dev->of_node, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c
index 59b89e421dc2..f2175c03502b 100644
--- a/drivers/media/platform/intel/pxa_camera.c
+++ b/drivers/media/platform/intel/pxa_camera.c
@@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
 		pcdev->mclk = mclk_rate;
 	}
 
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(dev, "could not find endpoint\n");
 		return -EINVAL;
diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
index 5ac149cf3647..201049c047b0 100644
--- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
@@ -363,7 +363,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
index 73445f33d26b..b617a9bcd398 100644
--- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
@@ -349,7 +349,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 8e78dd8d5961..cbb6f88cfe4a 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1136,7 +1136,7 @@ static int camss_of_parse_ports(struct camss *camss)
 	struct device_node *remote = NULL;
 	int ret, num_subdevs = 0;
 
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		struct camss_async_subdev *csd;
 
 		if (!of_device_is_available(node))
diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
index 2562b30acfb9..929d17de4ac9 100644
--- a/drivers/media/platform/renesas/renesas-ceu.c
+++ b/drivers/media/platform/renesas/renesas-ceu.c
@@ -1526,7 +1526,7 @@ static int ceu_parse_dt(struct ceu_device *ceudev)
 	int num_ep;
 	int ret;
 
-	num_ep = of_graph_get_endpoint_count(of);
+	num_ep = of_graph_get_device_endpoint_count(of);
 	if (!num_ep)
 		return -ENODEV;
 
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index a08c87ef6e2d..5ab0399b7718 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
 		return -EINVAL;
 	}
 
-	ep = of_graph_get_next_endpoint(node, NULL);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return -ENXIO;
 
diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
index 686ca8753ba2..a332b4bd76f2 100644
--- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
@@ -728,7 +728,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
 				 &state->max_num_lanes))
 		return -EINVAL;
 
-	node = of_graph_get_next_endpoint(node, NULL);
+	node = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node) {
 		dev_err(&pdev->dev, "No port node at %pOF\n",
 				pdev->dev.of_node);
diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 8cb4fdcae137..320101f4ad40 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -1856,7 +1856,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(dcmi->dev->of_node, NULL);
 	if (!ep) {
 		dev_err(dcmi->dev, "Failed to get next endpoint\n");
 		return -EINVAL;
@@ -1915,7 +1915,7 @@ static int dcmi_probe(struct platform_device *pdev)
 				     "Could not get reset control\n");
 
 	/* Get bus characteristics from devicetree */
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(&pdev->dev, "Could not find the endpoint\n");
 		return -ENODEV;
diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
index 5fa2ea9025d9..46876865ec6a 100644
--- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
@@ -2309,7 +2309,7 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
 		struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
 		struct device_node *rem;
 
-		endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint);
+		endpoint = of_graph_get_next_device_endpoint(dev->of_node, endpoint);
 		if (!endpoint)
 			break;
 
diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c
index 63cdfed37bc9..021ca79e832b 100644
--- a/drivers/media/platform/ti/davinci/vpif.c
+++ b/drivers/media/platform/ti/davinci/vpif.c
@@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev)
 	 * so their devices need to be registered manually here
 	 * for their legacy platform_drivers to work.
 	 */
-	endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
-					      endpoint);
+	endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
 	if (!endpoint)
 		return 0;
 	of_node_put(endpoint);
diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
index 99fae8830c41..805c313b41dc 100644
--- a/drivers/media/platform/ti/davinci/vpif_capture.c
+++ b/drivers/media/platform/ti/davinci/vpif_capture.c
@@ -1521,8 +1521,7 @@ vpif_capture_get_pdata(struct platform_device *pdev,
 		unsigned int flags;
 		int err;
 
-		endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
-						      endpoint);
+		endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
 		if (!endpoint)
 			break;
 
diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
index 5de6b6694f53..61d84ade7155 100644
--- a/drivers/media/platform/video-mux.c
+++ b/drivers/media/platform/video-mux.c
@@ -408,7 +408,7 @@ static int video_mux_probe(struct platform_device *pdev)
 	 * The largest numbered port is the output port. It determines
 	 * total number of pads.
 	 */
-	for_each_endpoint_of_node(np, ep) {
+	for_each_device_endpoint_of_node(np, ep) {
 		struct of_endpoint endpoint;
 
 		of_graph_parse_endpoint(ep, &endpoint);
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index 996684a73038..9230931d6d7a 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -207,7 +207,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
 
 	while (1) {
 		/* Get the next endpoint and parse its link. */
-		ep = of_graph_get_next_endpoint(node, ep);
+		ep = of_graph_get_next_device_endpoint(node, ep);
 		if (ep == NULL)
 			break;
 
-- 
2.25.1


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

* [PATCH v3 06/24] media: platform: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/platform/atmel/atmel-isi.c                 | 4 ++--
 drivers/media/platform/intel/pxa_camera.c                | 2 +-
 drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 +-
 drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 +-
 drivers/media/platform/qcom/camss/camss.c                | 2 +-
 drivers/media/platform/renesas/renesas-ceu.c             | 2 +-
 drivers/media/platform/samsung/exynos4-is/fimc-is.c      | 2 +-
 drivers/media/platform/samsung/exynos4-is/mipi-csis.c    | 2 +-
 drivers/media/platform/st/stm32/stm32-dcmi.c             | 4 ++--
 drivers/media/platform/ti/am437x/am437x-vpfe.c           | 2 +-
 drivers/media/platform/ti/davinci/vpif.c                 | 3 +--
 drivers/media/platform/ti/davinci/vpif_capture.c         | 3 +--
 drivers/media/platform/video-mux.c                       | 2 +-
 drivers/media/platform/xilinx/xilinx-vipp.c              | 2 +-
 14 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 4046212d48b4..4317750d05ad 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -831,7 +831,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
 	isi->pdata.full_mode = 1;
 	isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
 
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(&pdev->dev, "Could not find the endpoint\n");
 		return -EINVAL;
@@ -1155,7 +1155,7 @@ static int isi_graph_init(struct atmel_isi *isi)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(isi->dev->of_node, NULL);
 	if (!ep)
 		return -EINVAL;
 
diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c
index 59b89e421dc2..f2175c03502b 100644
--- a/drivers/media/platform/intel/pxa_camera.c
+++ b/drivers/media/platform/intel/pxa_camera.c
@@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
 		pcdev->mclk = mclk_rate;
 	}
 
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(dev, "could not find endpoint\n");
 		return -EINVAL;
diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
index 5ac149cf3647..201049c047b0 100644
--- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
@@ -363,7 +363,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
index 73445f33d26b..b617a9bcd398 100644
--- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
+++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
@@ -349,7 +349,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 8e78dd8d5961..cbb6f88cfe4a 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1136,7 +1136,7 @@ static int camss_of_parse_ports(struct camss *camss)
 	struct device_node *remote = NULL;
 	int ret, num_subdevs = 0;
 
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		struct camss_async_subdev *csd;
 
 		if (!of_device_is_available(node))
diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
index 2562b30acfb9..929d17de4ac9 100644
--- a/drivers/media/platform/renesas/renesas-ceu.c
+++ b/drivers/media/platform/renesas/renesas-ceu.c
@@ -1526,7 +1526,7 @@ static int ceu_parse_dt(struct ceu_device *ceudev)
 	int num_ep;
 	int ret;
 
-	num_ep = of_graph_get_endpoint_count(of);
+	num_ep = of_graph_get_device_endpoint_count(of);
 	if (!num_ep)
 		return -ENODEV;
 
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index a08c87ef6e2d..5ab0399b7718 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
 		return -EINVAL;
 	}
 
-	ep = of_graph_get_next_endpoint(node, NULL);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return -ENXIO;
 
diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
index 686ca8753ba2..a332b4bd76f2 100644
--- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
@@ -728,7 +728,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
 				 &state->max_num_lanes))
 		return -EINVAL;
 
-	node = of_graph_get_next_endpoint(node, NULL);
+	node = of_graph_get_next_device_endpoint(node, NULL);
 	if (!node) {
 		dev_err(&pdev->dev, "No port node at %pOF\n",
 				pdev->dev.of_node);
diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 8cb4fdcae137..320101f4ad40 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -1856,7 +1856,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi)
 	struct device_node *ep;
 	int ret;
 
-	ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL);
+	ep = of_graph_get_next_device_endpoint(dcmi->dev->of_node, NULL);
 	if (!ep) {
 		dev_err(dcmi->dev, "Failed to get next endpoint\n");
 		return -EINVAL;
@@ -1915,7 +1915,7 @@ static int dcmi_probe(struct platform_device *pdev)
 				     "Could not get reset control\n");
 
 	/* Get bus characteristics from devicetree */
-	np = of_graph_get_next_endpoint(np, NULL);
+	np = of_graph_get_next_device_endpoint(np, NULL);
 	if (!np) {
 		dev_err(&pdev->dev, "Could not find the endpoint\n");
 		return -ENODEV;
diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
index 5fa2ea9025d9..46876865ec6a 100644
--- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
@@ -2309,7 +2309,7 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
 		struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
 		struct device_node *rem;
 
-		endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint);
+		endpoint = of_graph_get_next_device_endpoint(dev->of_node, endpoint);
 		if (!endpoint)
 			break;
 
diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c
index 63cdfed37bc9..021ca79e832b 100644
--- a/drivers/media/platform/ti/davinci/vpif.c
+++ b/drivers/media/platform/ti/davinci/vpif.c
@@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev)
 	 * so their devices need to be registered manually here
 	 * for their legacy platform_drivers to work.
 	 */
-	endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
-					      endpoint);
+	endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
 	if (!endpoint)
 		return 0;
 	of_node_put(endpoint);
diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
index 99fae8830c41..805c313b41dc 100644
--- a/drivers/media/platform/ti/davinci/vpif_capture.c
+++ b/drivers/media/platform/ti/davinci/vpif_capture.c
@@ -1521,8 +1521,7 @@ vpif_capture_get_pdata(struct platform_device *pdev,
 		unsigned int flags;
 		int err;
 
-		endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
-						      endpoint);
+		endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
 		if (!endpoint)
 			break;
 
diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
index 5de6b6694f53..61d84ade7155 100644
--- a/drivers/media/platform/video-mux.c
+++ b/drivers/media/platform/video-mux.c
@@ -408,7 +408,7 @@ static int video_mux_probe(struct platform_device *pdev)
 	 * The largest numbered port is the output port. It determines
 	 * total number of pads.
 	 */
-	for_each_endpoint_of_node(np, ep) {
+	for_each_device_endpoint_of_node(np, ep) {
 		struct of_endpoint endpoint;
 
 		of_graph_parse_endpoint(ep, &endpoint);
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index 996684a73038..9230931d6d7a 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -207,7 +207,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
 
 	while (1) {
 		/* Get the next endpoint and parse its link. */
-		ep = of_graph_get_next_endpoint(node, ep);
+		ep = of_graph_get_next_device_endpoint(node, ep);
 		if (ep == NULL)
 			break;
 
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 07/24] gpu: drm: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/armada/armada_drv.c                   | 2 +-
 drivers/gpu/drm/bridge/tc358767.c                     | 2 +-
 drivers/gpu/drm/drm_of.c                              | 6 +++---
 drivers/gpu/drm/meson/meson_drv.c                     | 4 ++--
 drivers/gpu/drm/msm/msm_drv.c                         | 2 +-
 drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 2 +-
 drivers/gpu/drm/omapdrm/dss/base.c                    | 2 +-
 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
 drivers/gpu/drm/pl111/pl111_drv.c                     | 2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 +-
 drivers/gpu/drm/stm/ltdc.c                            | 4 ++--
 drivers/gpu/drm/tiny/arcpgu.c                         | 2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index fa1c67598706..575c61c6711f 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -175,7 +175,7 @@ static void armada_add_endpoints(struct device *dev,
 {
 	struct device_node *ep, *remote;
 
-	for_each_endpoint_of_node(dev_node, ep) {
+	for_each_device_endpoint_of_node(dev_node, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (remote && of_device_is_available(remote))
 			drm_of_component_match_add(dev, match, component_compare_of,
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index ef2e373606ba..845d60943c52 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -2190,7 +2190,7 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
 	 * DSI -> port@0 -> port@1 -> DPI :: [port@2 is not connected]
 	 */
 
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		of_graph_parse_endpoint(node, &endpoint);
 		if (endpoint.port > 2) {
 			of_node_put(node);
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 177b600895d3..b322cc922aa1 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -63,7 +63,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 	struct device_node *remote_port, *ep;
 	uint32_t possible_crtcs = 0;
 
-	for_each_endpoint_of_node(port, ep) {
+	for_each_device_endpoint_of_node(port, ep) {
 		remote_port = of_graph_get_remote_port(ep);
 		if (!remote_port) {
 			of_node_put(ep);
@@ -203,7 +203,7 @@ int drm_of_encoder_active_endpoint(struct device_node *node,
 	if (!node || !crtc)
 		return -EINVAL;
 
-	for_each_endpoint_of_node(node, ep) {
+	for_each_device_endpoint_of_node(node, ep) {
 		port = of_graph_get_remote_port(ep);
 		of_node_put(port);
 		if (port == crtc->port) {
@@ -516,7 +516,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev)
 	/*
 	 * Get first endpoint child from device.
 	 */
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint)
 		return ERR_PTR(-ENODEV);
 
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index cb674966e9ac..338a7b90d1c3 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -113,7 +113,7 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
 	struct device_node *ep, *remote;
 
 	/* Parses each endpoint and check if remote exists */
-	for_each_endpoint_of_node(dev->of_node, ep) {
+	for_each_device_endpoint_of_node(dev->of_node, ep) {
 		/* If the endpoint node exists, consider it enabled */
 		remote = of_graph_get_remote_port(ep);
 		if (remote) {
@@ -481,7 +481,7 @@ static int meson_drv_probe(struct platform_device *pdev)
 	struct device_node *ep, *remote;
 	int count = 0;
 
-	for_each_endpoint_of_node(np, ep) {
+	for_each_device_endpoint_of_node(np, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (!remote || !of_device_is_available(remote)) {
 			of_node_put(remote);
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 3f217b578293..43e3f22c5520 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -840,7 +840,7 @@ static int add_components_mdp(struct device *master_dev,
 	struct device_node *np = master_dev->of_node;
 	struct device_node *ep_node;
 
-	for_each_endpoint_of_node(np, ep_node) {
+	for_each_device_endpoint_of_node(np, ep_node) {
 		struct device_node *intf;
 		struct of_endpoint ep;
 		int ret;
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 18de2f17e249..e46ae576ca92 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -51,7 +51,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
 	struct drm_bridge *bridge;
 	int ret;
 
-	for_each_endpoint_of_node(dev->of_node, ep) {
+	for_each_device_endpoint_of_node(dev->of_node, ep) {
 		struct device_node *remote;
 		struct of_endpoint of_ep;
 		struct drm_encoder *encoder;
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 050ca7eafac5..085bde7b2dee 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -243,7 +243,7 @@ static void omapdss_walk_device(struct device *dev, struct device_node *node,
 	of_node_put(n);
 
 	n = NULL;
-	while ((n = of_graph_get_next_endpoint(node, n)) != NULL) {
+	while ((n = of_graph_get_next_device_endpoint(node, n)) != NULL) {
 		struct device_node *pn = of_graph_get_remote_port_parent(n);
 
 		if (!pn)
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 4618c892cdd6..d479ea7a0183 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
 	rpi_touchscreen_i2c_write(ts, REG_POWERON, 0);
 
 	/* Look up the DSI host.  It needs to probe before we do. */
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint)
 		return -ENODEV;
 
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 02e6b74d5016..a5e8d79baf4d 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -93,7 +93,7 @@ static int pl111_modeset_init(struct drm_device *dev)
 	mode_config->max_height = 768;
 
 	i = 0;
-	for_each_endpoint_of_node(np, remote) {
+	for_each_device_endpoint_of_node(np, remote) {
 		struct drm_panel *tmp_panel;
 		struct drm_bridge *tmp_bridge;
 
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
index 70d8ad065bfa..97c642edf408 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
@@ -609,7 +609,7 @@ static int rcar_du_encoders_init(struct rcar_du_device *rcdu)
 	 * Iterate over the endpoints and create one encoder for each output
 	 * pipeline.
 	 */
-	for_each_endpoint_of_node(np, ep_node) {
+	for_each_device_endpoint_of_node(np, ep_node) {
 		enum rcar_du_output output;
 		struct of_endpoint ep;
 		unsigned int i;
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 5576fdae4962..6af275a157b3 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1931,7 +1931,7 @@ int ltdc_load(struct drm_device *ddev)
 	DRM_DEBUG_DRIVER("\n");
 
 	/* Get number of endpoints */
-	nb_endpoints = of_graph_get_endpoint_count(np);
+	nb_endpoints = of_graph_get_device_endpoint_count(np);
 	if (!nb_endpoints)
 		return -ENODEV;
 
@@ -2087,7 +2087,7 @@ void ltdc_unload(struct drm_device *ddev)
 
 	DRM_DEBUG_DRIVER("\n");
 
-	nb_endpoints = of_graph_get_endpoint_count(dev->of_node);
+	nb_endpoints = of_graph_get_device_endpoint_count(dev->of_node);
 
 	for (i = 0; i < nb_endpoints; i++)
 		drm_of_panel_bridge_remove(ddev->dev->of_node, 0, i);
diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index e5b10e41554a..1cf3a7bda035 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -288,7 +288,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	 * There is only one output port inside each device. It is linked with
 	 * encoder endpoint.
 	 */
-	endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
+	endpoint_node = of_graph_get_next_device_endpoint(pdev->dev.of_node, NULL);
 	if (endpoint_node) {
 		encoder_node = of_graph_get_remote_port_parent(endpoint_node);
 		of_node_put(endpoint_node);
-- 
2.25.1


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

* [PATCH v3 07/24] gpu: drm: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/armada/armada_drv.c                   | 2 +-
 drivers/gpu/drm/bridge/tc358767.c                     | 2 +-
 drivers/gpu/drm/drm_of.c                              | 6 +++---
 drivers/gpu/drm/meson/meson_drv.c                     | 4 ++--
 drivers/gpu/drm/msm/msm_drv.c                         | 2 +-
 drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 2 +-
 drivers/gpu/drm/omapdrm/dss/base.c                    | 2 +-
 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
 drivers/gpu/drm/pl111/pl111_drv.c                     | 2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 +-
 drivers/gpu/drm/stm/ltdc.c                            | 4 ++--
 drivers/gpu/drm/tiny/arcpgu.c                         | 2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index fa1c67598706..575c61c6711f 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -175,7 +175,7 @@ static void armada_add_endpoints(struct device *dev,
 {
 	struct device_node *ep, *remote;
 
-	for_each_endpoint_of_node(dev_node, ep) {
+	for_each_device_endpoint_of_node(dev_node, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (remote && of_device_is_available(remote))
 			drm_of_component_match_add(dev, match, component_compare_of,
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index ef2e373606ba..845d60943c52 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -2190,7 +2190,7 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
 	 * DSI -> port@0 -> port@1 -> DPI :: [port@2 is not connected]
 	 */
 
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		of_graph_parse_endpoint(node, &endpoint);
 		if (endpoint.port > 2) {
 			of_node_put(node);
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 177b600895d3..b322cc922aa1 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -63,7 +63,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 	struct device_node *remote_port, *ep;
 	uint32_t possible_crtcs = 0;
 
-	for_each_endpoint_of_node(port, ep) {
+	for_each_device_endpoint_of_node(port, ep) {
 		remote_port = of_graph_get_remote_port(ep);
 		if (!remote_port) {
 			of_node_put(ep);
@@ -203,7 +203,7 @@ int drm_of_encoder_active_endpoint(struct device_node *node,
 	if (!node || !crtc)
 		return -EINVAL;
 
-	for_each_endpoint_of_node(node, ep) {
+	for_each_device_endpoint_of_node(node, ep) {
 		port = of_graph_get_remote_port(ep);
 		of_node_put(port);
 		if (port == crtc->port) {
@@ -516,7 +516,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev)
 	/*
 	 * Get first endpoint child from device.
 	 */
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint)
 		return ERR_PTR(-ENODEV);
 
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index cb674966e9ac..338a7b90d1c3 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -113,7 +113,7 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
 	struct device_node *ep, *remote;
 
 	/* Parses each endpoint and check if remote exists */
-	for_each_endpoint_of_node(dev->of_node, ep) {
+	for_each_device_endpoint_of_node(dev->of_node, ep) {
 		/* If the endpoint node exists, consider it enabled */
 		remote = of_graph_get_remote_port(ep);
 		if (remote) {
@@ -481,7 +481,7 @@ static int meson_drv_probe(struct platform_device *pdev)
 	struct device_node *ep, *remote;
 	int count = 0;
 
-	for_each_endpoint_of_node(np, ep) {
+	for_each_device_endpoint_of_node(np, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (!remote || !of_device_is_available(remote)) {
 			of_node_put(remote);
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 3f217b578293..43e3f22c5520 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -840,7 +840,7 @@ static int add_components_mdp(struct device *master_dev,
 	struct device_node *np = master_dev->of_node;
 	struct device_node *ep_node;
 
-	for_each_endpoint_of_node(np, ep_node) {
+	for_each_device_endpoint_of_node(np, ep_node) {
 		struct device_node *intf;
 		struct of_endpoint ep;
 		int ret;
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 18de2f17e249..e46ae576ca92 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -51,7 +51,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
 	struct drm_bridge *bridge;
 	int ret;
 
-	for_each_endpoint_of_node(dev->of_node, ep) {
+	for_each_device_endpoint_of_node(dev->of_node, ep) {
 		struct device_node *remote;
 		struct of_endpoint of_ep;
 		struct drm_encoder *encoder;
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 050ca7eafac5..085bde7b2dee 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -243,7 +243,7 @@ static void omapdss_walk_device(struct device *dev, struct device_node *node,
 	of_node_put(n);
 
 	n = NULL;
-	while ((n = of_graph_get_next_endpoint(node, n)) != NULL) {
+	while ((n = of_graph_get_next_device_endpoint(node, n)) != NULL) {
 		struct device_node *pn = of_graph_get_remote_port_parent(n);
 
 		if (!pn)
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 4618c892cdd6..d479ea7a0183 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
 	rpi_touchscreen_i2c_write(ts, REG_POWERON, 0);
 
 	/* Look up the DSI host.  It needs to probe before we do. */
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint)
 		return -ENODEV;
 
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 02e6b74d5016..a5e8d79baf4d 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -93,7 +93,7 @@ static int pl111_modeset_init(struct drm_device *dev)
 	mode_config->max_height = 768;
 
 	i = 0;
-	for_each_endpoint_of_node(np, remote) {
+	for_each_device_endpoint_of_node(np, remote) {
 		struct drm_panel *tmp_panel;
 		struct drm_bridge *tmp_bridge;
 
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
index 70d8ad065bfa..97c642edf408 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
@@ -609,7 +609,7 @@ static int rcar_du_encoders_init(struct rcar_du_device *rcdu)
 	 * Iterate over the endpoints and create one encoder for each output
 	 * pipeline.
 	 */
-	for_each_endpoint_of_node(np, ep_node) {
+	for_each_device_endpoint_of_node(np, ep_node) {
 		enum rcar_du_output output;
 		struct of_endpoint ep;
 		unsigned int i;
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 5576fdae4962..6af275a157b3 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1931,7 +1931,7 @@ int ltdc_load(struct drm_device *ddev)
 	DRM_DEBUG_DRIVER("\n");
 
 	/* Get number of endpoints */
-	nb_endpoints = of_graph_get_endpoint_count(np);
+	nb_endpoints = of_graph_get_device_endpoint_count(np);
 	if (!nb_endpoints)
 		return -ENODEV;
 
@@ -2087,7 +2087,7 @@ void ltdc_unload(struct drm_device *ddev)
 
 	DRM_DEBUG_DRIVER("\n");
 
-	nb_endpoints = of_graph_get_endpoint_count(dev->of_node);
+	nb_endpoints = of_graph_get_device_endpoint_count(dev->of_node);
 
 	for (i = 0; i < nb_endpoints; i++)
 		drm_of_panel_bridge_remove(ddev->dev->of_node, 0, i);
diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index e5b10e41554a..1cf3a7bda035 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -288,7 +288,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	 * There is only one output port inside each device. It is linked with
 	 * encoder endpoint.
 	 */
-	endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
+	endpoint_node = of_graph_get_next_device_endpoint(pdev->dev.of_node, NULL);
 	if (endpoint_node) {
 		encoder_node = of_graph_get_remote_port_parent(endpoint_node);
 		of_node_put(endpoint_node);
-- 
2.25.1


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

* [PATCH v3 07/24] gpu: drm: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/armada/armada_drv.c                   | 2 +-
 drivers/gpu/drm/bridge/tc358767.c                     | 2 +-
 drivers/gpu/drm/drm_of.c                              | 6 +++---
 drivers/gpu/drm/meson/meson_drv.c                     | 4 ++--
 drivers/gpu/drm/msm/msm_drv.c                         | 2 +-
 drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 2 +-
 drivers/gpu/drm/omapdrm/dss/base.c                    | 2 +-
 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
 drivers/gpu/drm/pl111/pl111_drv.c                     | 2 +-
 drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 +-
 drivers/gpu/drm/stm/ltdc.c                            | 4 ++--
 drivers/gpu/drm/tiny/arcpgu.c                         | 2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index fa1c67598706..575c61c6711f 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -175,7 +175,7 @@ static void armada_add_endpoints(struct device *dev,
 {
 	struct device_node *ep, *remote;
 
-	for_each_endpoint_of_node(dev_node, ep) {
+	for_each_device_endpoint_of_node(dev_node, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (remote && of_device_is_available(remote))
 			drm_of_component_match_add(dev, match, component_compare_of,
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index ef2e373606ba..845d60943c52 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -2190,7 +2190,7 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
 	 * DSI -> port@0 -> port@1 -> DPI :: [port@2 is not connected]
 	 */
 
-	for_each_endpoint_of_node(dev->of_node, node) {
+	for_each_device_endpoint_of_node(dev->of_node, node) {
 		of_graph_parse_endpoint(node, &endpoint);
 		if (endpoint.port > 2) {
 			of_node_put(node);
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 177b600895d3..b322cc922aa1 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -63,7 +63,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 	struct device_node *remote_port, *ep;
 	uint32_t possible_crtcs = 0;
 
-	for_each_endpoint_of_node(port, ep) {
+	for_each_device_endpoint_of_node(port, ep) {
 		remote_port = of_graph_get_remote_port(ep);
 		if (!remote_port) {
 			of_node_put(ep);
@@ -203,7 +203,7 @@ int drm_of_encoder_active_endpoint(struct device_node *node,
 	if (!node || !crtc)
 		return -EINVAL;
 
-	for_each_endpoint_of_node(node, ep) {
+	for_each_device_endpoint_of_node(node, ep) {
 		port = of_graph_get_remote_port(ep);
 		of_node_put(port);
 		if (port == crtc->port) {
@@ -516,7 +516,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev)
 	/*
 	 * Get first endpoint child from device.
 	 */
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint)
 		return ERR_PTR(-ENODEV);
 
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index cb674966e9ac..338a7b90d1c3 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -113,7 +113,7 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
 	struct device_node *ep, *remote;
 
 	/* Parses each endpoint and check if remote exists */
-	for_each_endpoint_of_node(dev->of_node, ep) {
+	for_each_device_endpoint_of_node(dev->of_node, ep) {
 		/* If the endpoint node exists, consider it enabled */
 		remote = of_graph_get_remote_port(ep);
 		if (remote) {
@@ -481,7 +481,7 @@ static int meson_drv_probe(struct platform_device *pdev)
 	struct device_node *ep, *remote;
 	int count = 0;
 
-	for_each_endpoint_of_node(np, ep) {
+	for_each_device_endpoint_of_node(np, ep) {
 		remote = of_graph_get_remote_port_parent(ep);
 		if (!remote || !of_device_is_available(remote)) {
 			of_node_put(remote);
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 3f217b578293..43e3f22c5520 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -840,7 +840,7 @@ static int add_components_mdp(struct device *master_dev,
 	struct device_node *np = master_dev->of_node;
 	struct device_node *ep_node;
 
-	for_each_endpoint_of_node(np, ep_node) {
+	for_each_device_endpoint_of_node(np, ep_node) {
 		struct device_node *intf;
 		struct of_endpoint ep;
 		int ret;
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 18de2f17e249..e46ae576ca92 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -51,7 +51,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
 	struct drm_bridge *bridge;
 	int ret;
 
-	for_each_endpoint_of_node(dev->of_node, ep) {
+	for_each_device_endpoint_of_node(dev->of_node, ep) {
 		struct device_node *remote;
 		struct of_endpoint of_ep;
 		struct drm_encoder *encoder;
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 050ca7eafac5..085bde7b2dee 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -243,7 +243,7 @@ static void omapdss_walk_device(struct device *dev, struct device_node *node,
 	of_node_put(n);
 
 	n = NULL;
-	while ((n = of_graph_get_next_endpoint(node, n)) != NULL) {
+	while ((n = of_graph_get_next_device_endpoint(node, n)) != NULL) {
 		struct device_node *pn = of_graph_get_remote_port_parent(n);
 
 		if (!pn)
diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
index 4618c892cdd6..d479ea7a0183 100644
--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
+++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c
@@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c)
 	rpi_touchscreen_i2c_write(ts, REG_POWERON, 0);
 
 	/* Look up the DSI host.  It needs to probe before we do. */
-	endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
+	endpoint = of_graph_get_next_device_endpoint(dev->of_node, NULL);
 	if (!endpoint)
 		return -ENODEV;
 
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 02e6b74d5016..a5e8d79baf4d 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -93,7 +93,7 @@ static int pl111_modeset_init(struct drm_device *dev)
 	mode_config->max_height = 768;
 
 	i = 0;
-	for_each_endpoint_of_node(np, remote) {
+	for_each_device_endpoint_of_node(np, remote) {
 		struct drm_panel *tmp_panel;
 		struct drm_bridge *tmp_bridge;
 
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
index 70d8ad065bfa..97c642edf408 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
@@ -609,7 +609,7 @@ static int rcar_du_encoders_init(struct rcar_du_device *rcdu)
 	 * Iterate over the endpoints and create one encoder for each output
 	 * pipeline.
 	 */
-	for_each_endpoint_of_node(np, ep_node) {
+	for_each_device_endpoint_of_node(np, ep_node) {
 		enum rcar_du_output output;
 		struct of_endpoint ep;
 		unsigned int i;
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 5576fdae4962..6af275a157b3 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1931,7 +1931,7 @@ int ltdc_load(struct drm_device *ddev)
 	DRM_DEBUG_DRIVER("\n");
 
 	/* Get number of endpoints */
-	nb_endpoints = of_graph_get_endpoint_count(np);
+	nb_endpoints = of_graph_get_device_endpoint_count(np);
 	if (!nb_endpoints)
 		return -ENODEV;
 
@@ -2087,7 +2087,7 @@ void ltdc_unload(struct drm_device *ddev)
 
 	DRM_DEBUG_DRIVER("\n");
 
-	nb_endpoints = of_graph_get_endpoint_count(dev->of_node);
+	nb_endpoints = of_graph_get_device_endpoint_count(dev->of_node);
 
 	for (i = 0; i < nb_endpoints; i++)
 		drm_of_panel_bridge_remove(ddev->dev->of_node, 0, i);
diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index e5b10e41554a..1cf3a7bda035 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -288,7 +288,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
 	 * There is only one output port inside each device. It is linked with
 	 * encoder endpoint.
 	 */
-	endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL);
+	endpoint_node = of_graph_get_next_device_endpoint(pdev->dev.of_node, NULL);
 	if (endpoint_node) {
 		encoder_node = of_graph_get_remote_port_parent(endpoint_node);
 		of_node_put(endpoint_node);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 08/24] hwtracing: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/hwtracing/coresight/coresight-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 9d550f5697fa..944b2e66c04e 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -275,7 +275,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	 */
 	if (!parent) {
 		/*
-		 * Avoid warnings in of_graph_get_next_endpoint()
+		 * Avoid warnings in of_graph_get_next_device_endpoint()
 		 * if the device doesn't have any graph connections
 		 */
 		if (!of_graph_is_present(node))
@@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	}
 
 	/* Iterate through each output port to discover topology */
-	while ((ep = of_graph_get_next_endpoint(parent, ep))) {
+	while ((ep = of_graph_get_next_device_endpoint(parent, ep))) {
 		/*
 		 * Legacy binding mixes input/output ports under the
 		 * same parent. So, skip the input ports if we are dealing
-- 
2.25.1


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

* [PATCH v3 08/24] hwtracing: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/hwtracing/coresight/coresight-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 9d550f5697fa..944b2e66c04e 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -275,7 +275,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	 */
 	if (!parent) {
 		/*
-		 * Avoid warnings in of_graph_get_next_endpoint()
+		 * Avoid warnings in of_graph_get_next_device_endpoint()
 		 * if the device doesn't have any graph connections
 		 */
 		if (!of_graph_is_present(node))
@@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	}
 
 	/* Iterate through each output port to discover topology */
-	while ((ep = of_graph_get_next_endpoint(parent, ep))) {
+	while ((ep = of_graph_get_next_device_endpoint(parent, ep))) {
 		/*
 		 * Legacy binding mixes input/output ports under the
 		 * same parent. So, skip the input ports if we are dealing
-- 
2.25.1


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

* [PATCH v3 08/24] hwtracing: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/hwtracing/coresight/coresight-platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
index 9d550f5697fa..944b2e66c04e 100644
--- a/drivers/hwtracing/coresight/coresight-platform.c
+++ b/drivers/hwtracing/coresight/coresight-platform.c
@@ -275,7 +275,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	 */
 	if (!parent) {
 		/*
-		 * Avoid warnings in of_graph_get_next_endpoint()
+		 * Avoid warnings in of_graph_get_next_device_endpoint()
 		 * if the device doesn't have any graph connections
 		 */
 		if (!of_graph_is_present(node))
@@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct device *dev,
 	}
 
 	/* Iterate through each output port to discover topology */
-	while ((ep = of_graph_get_next_endpoint(parent, ep))) {
+	while ((ep = of_graph_get_next_device_endpoint(parent, ep))) {
 		/*
 		 * Legacy binding mixes input/output ports under the
 		 * same parent. So, skip the input ports if we are dealing
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 09/24] staging: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:05   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 2 +-
 drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 2 +-
 drivers/staging/media/tegra-video/csi.c                    | 2 +-
 drivers/staging/media/tegra-video/vi.c                     | 2 +-
 drivers/staging/media/tegra-video/vip.c                    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
index 31b2b48085c5..bed11223e4be 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
@@ -343,7 +343,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
index 020034f631f5..e0dcec334ae2 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
@@ -329,7 +329,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
index 9aa72863c213..2135dca9725e 100644
--- a/drivers/staging/media/tegra-video/csi.c
+++ b/drivers/staging/media/tegra-video/csi.c
@@ -571,7 +571,7 @@ static int tegra_csi_channels_alloc(struct tegra_csi *csi)
 			goto err_node_put;
 		}
 
-		num_pads = of_graph_get_endpoint_count(channel);
+		num_pads = of_graph_get_device_endpoint_count(channel);
 		if (num_pads == TEGRA_CSI_PADS_NUM) {
 			ret = tegra_csi_channel_alloc(csi, channel, portno,
 						      lanes, num_pads);
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index 94171e62dee9..de63721495ef 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1704,7 +1704,7 @@ static int tegra_vi_graph_parse_one(struct tegra_vi_channel *chan,
 	dev_dbg(vi->dev, "parsing node %pOF\n", to_of_node(fwnode));
 
 	/* parse all the remote entities and put them into the list */
-	for_each_endpoint_of_node(to_of_node(fwnode), node) {
+	for_each_device_endpoint_of_node(to_of_node(fwnode), node) {
 		ep = of_fwnode_handle(node);
 		remote = fwnode_graph_get_remote_port_parent(ep);
 		if (!remote) {
diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c
index e95cc7bb190e..78b3cdf7ee29 100644
--- a/drivers/staging/media/tegra-video/vip.c
+++ b/drivers/staging/media/tegra-video/vip.c
@@ -137,7 +137,7 @@ static int tegra_vip_channel_of_parse(struct tegra_vip *vip)
 		goto err_node_put;
 	}
 
-	num_pads = of_graph_get_endpoint_count(np);
+	num_pads = of_graph_get_device_endpoint_count(np);
 	if (num_pads != TEGRA_VIP_PADS_NUM) {
 		err = -EINVAL;
 		dev_err_probe(dev, err, "%pOF: need 2 pads, got %d\n", np, num_pads);
-- 
2.25.1


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

* [PATCH v3 09/24] staging: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 2 +-
 drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 2 +-
 drivers/staging/media/tegra-video/csi.c                    | 2 +-
 drivers/staging/media/tegra-video/vi.c                     | 2 +-
 drivers/staging/media/tegra-video/vip.c                    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
index 31b2b48085c5..bed11223e4be 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
@@ -343,7 +343,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
index 020034f631f5..e0dcec334ae2 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
@@ -329,7 +329,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
index 9aa72863c213..2135dca9725e 100644
--- a/drivers/staging/media/tegra-video/csi.c
+++ b/drivers/staging/media/tegra-video/csi.c
@@ -571,7 +571,7 @@ static int tegra_csi_channels_alloc(struct tegra_csi *csi)
 			goto err_node_put;
 		}
 
-		num_pads = of_graph_get_endpoint_count(channel);
+		num_pads = of_graph_get_device_endpoint_count(channel);
 		if (num_pads == TEGRA_CSI_PADS_NUM) {
 			ret = tegra_csi_channel_alloc(csi, channel, portno,
 						      lanes, num_pads);
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index 94171e62dee9..de63721495ef 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1704,7 +1704,7 @@ static int tegra_vi_graph_parse_one(struct tegra_vi_channel *chan,
 	dev_dbg(vi->dev, "parsing node %pOF\n", to_of_node(fwnode));
 
 	/* parse all the remote entities and put them into the list */
-	for_each_endpoint_of_node(to_of_node(fwnode), node) {
+	for_each_device_endpoint_of_node(to_of_node(fwnode), node) {
 		ep = of_fwnode_handle(node);
 		remote = fwnode_graph_get_remote_port_parent(ep);
 		if (!remote) {
diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c
index e95cc7bb190e..78b3cdf7ee29 100644
--- a/drivers/staging/media/tegra-video/vip.c
+++ b/drivers/staging/media/tegra-video/vip.c
@@ -137,7 +137,7 @@ static int tegra_vip_channel_of_parse(struct tegra_vip *vip)
 		goto err_node_put;
 	}
 
-	num_pads = of_graph_get_endpoint_count(np);
+	num_pads = of_graph_get_device_endpoint_count(np);
 	if (num_pads != TEGRA_VIP_PADS_NUM) {
 		err = -EINVAL;
 		dev_err_probe(dev, err, "%pOF: need 2 pads, got %d\n", np, num_pads);
-- 
2.25.1


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

* [PATCH v3 09/24] staging: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:05   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:05 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 2 +-
 drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 2 +-
 drivers/staging/media/tegra-video/csi.c                    | 2 +-
 drivers/staging/media/tegra-video/vi.c                     | 2 +-
 drivers/staging/media/tegra-video/vip.c                    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
index 31b2b48085c5..bed11223e4be 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
@@ -343,7 +343,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
index 020034f631f5..e0dcec334ae2 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
@@ -329,7 +329,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
 	while (1) {
 		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
 
-		epn = of_graph_get_next_endpoint(np, epn);
+		epn = of_graph_get_next_device_endpoint(np, epn);
 		if (!epn)
 			return 0;
 
diff --git a/drivers/staging/media/tegra-video/csi.c b/drivers/staging/media/tegra-video/csi.c
index 9aa72863c213..2135dca9725e 100644
--- a/drivers/staging/media/tegra-video/csi.c
+++ b/drivers/staging/media/tegra-video/csi.c
@@ -571,7 +571,7 @@ static int tegra_csi_channels_alloc(struct tegra_csi *csi)
 			goto err_node_put;
 		}
 
-		num_pads = of_graph_get_endpoint_count(channel);
+		num_pads = of_graph_get_device_endpoint_count(channel);
 		if (num_pads == TEGRA_CSI_PADS_NUM) {
 			ret = tegra_csi_channel_alloc(csi, channel, portno,
 						      lanes, num_pads);
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index 94171e62dee9..de63721495ef 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1704,7 +1704,7 @@ static int tegra_vi_graph_parse_one(struct tegra_vi_channel *chan,
 	dev_dbg(vi->dev, "parsing node %pOF\n", to_of_node(fwnode));
 
 	/* parse all the remote entities and put them into the list */
-	for_each_endpoint_of_node(to_of_node(fwnode), node) {
+	for_each_device_endpoint_of_node(to_of_node(fwnode), node) {
 		ep = of_fwnode_handle(node);
 		remote = fwnode_graph_get_remote_port_parent(ep);
 		if (!remote) {
diff --git a/drivers/staging/media/tegra-video/vip.c b/drivers/staging/media/tegra-video/vip.c
index e95cc7bb190e..78b3cdf7ee29 100644
--- a/drivers/staging/media/tegra-video/vip.c
+++ b/drivers/staging/media/tegra-video/vip.c
@@ -137,7 +137,7 @@ static int tegra_vip_channel_of_parse(struct tegra_vip *vip)
 		goto err_node_put;
 	}
 
-	num_pads = of_graph_get_endpoint_count(np);
+	num_pads = of_graph_get_device_endpoint_count(np);
 	if (num_pads != TEGRA_VIP_PADS_NUM) {
 		err = -EINVAL;
 		dev_err_probe(dev, err, "%pOF: need 2 pads, got %d\n", np, num_pads);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 10/24] ASoC: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/ak4613.c             | 2 +-
 sound/soc/generic/audio-graph-card2.c | 2 +-
 sound/soc/generic/simple-card-utils.c | 6 +++---
 sound/soc/generic/test-component.c    | 4 ++--
 sound/soc/sh/rcar/core.c              | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
index 73fb35560e51..1e1d9c7abdc7 100644
--- a/sound/soc/codecs/ak4613.c
+++ b/sound/soc/codecs/ak4613.c
@@ -870,7 +870,7 @@ static void ak4613_parse_of(struct ak4613_priv *priv,
 	 * TDM support is assuming it is probed via Audio-Graph-Card style here.
 	 * Default is SDTIx1 if it was probed via Simple-Audio-Card for now.
 	 */
-	sdti_num = of_graph_get_endpoint_count(np);
+	sdti_num = of_graph_get_device_endpoint_count(np);
 	if ((sdti_num >= SDTx_MAX) || (sdti_num < 1))
 		sdti_num = 1;
 
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 62606e20be9a..c3763719a69f 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -1104,7 +1104,7 @@ static int graph_counter(struct device_node *lnk)
 
 		/*
 		 * CPU/Codec = N:M case has many endpoints.
-		 * We can't use of_graph_get_endpoint_count() here
+		 * We can't use of_graph_get_device_endpoint_count() here
 		 */
 		while(1) {
 			port = of_get_next_child(ports, port);
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 81077d16d22f..2c89b711b1ea 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -1049,7 +1049,7 @@ static int graph_get_dai_id(struct device_node *ep)
 	 */
 	i = 0;
 	id = -1;
-	for_each_endpoint_of_node(node, endpoint) {
+	for_each_device_endpoint_of_node(node, endpoint) {
 		if (endpoint == ep)
 			id = i;
 		i++;
@@ -1093,7 +1093,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 	/* Get dai->name */
 	args.np		= node;
 	args.args[0]	= graph_get_dai_id(ep);
-	args.args_count	= (of_graph_get_endpoint_count(node) > 1);
+	args.args_count	= (of_graph_get_device_endpoint_count(node) > 1);
 
 	/*
 	 * FIXME
@@ -1122,7 +1122,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 
 parse_dai_end:
 	if (is_single_link)
-		*is_single_link = of_graph_get_endpoint_count(node) == 1;
+		*is_single_link = of_graph_get_device_endpoint_count(node) == 1;
 
 	return 0;
 }
diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index e4967540a2e1..0ebacbcddee3 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -538,7 +538,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	struct test_priv *priv;
 	int num, ret, i;
 
-	num = of_graph_get_endpoint_count(node);
+	num = of_graph_get_device_endpoint_count(node);
 	if (!num) {
 		dev_err(dev, "no port exits\n");
 		return -EINVAL;
@@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	}
 
 	i = 0;
-	for_each_endpoint_of_node(node, ep) {
+	for_each_device_endpoint_of_node(node, ep) {
 		snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i);
 		ddriv[i].name = dname[i].name;
 
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 0b1aa23c1189..d0581232063a 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1298,7 +1298,7 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
 		if (!of_node_name_eq(ports, "ports") &&
 		    !of_node_name_eq(ports, "port"))
 			continue;
-		priv->component_dais[i] = of_graph_get_endpoint_count(ports);
+		priv->component_dais[i] = of_graph_get_device_endpoint_count(ports);
 		nr += priv->component_dais[i];
 		i++;
 		if (i >= RSND_MAX_COMPONENT) {
@@ -1510,7 +1510,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
 			if (!of_node_name_eq(ports, "ports") &&
 			    !of_node_name_eq(ports, "port"))
 				continue;
-			for_each_endpoint_of_node(ports, dai_np) {
+			for_each_device_endpoint_of_node(ports, dai_np) {
 				__rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i);
 				if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) {
 					rdai = rsnd_rdai_get(priv, dai_i);
-- 
2.25.1


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

* [PATCH v3 10/24] ASoC: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/ak4613.c             | 2 +-
 sound/soc/generic/audio-graph-card2.c | 2 +-
 sound/soc/generic/simple-card-utils.c | 6 +++---
 sound/soc/generic/test-component.c    | 4 ++--
 sound/soc/sh/rcar/core.c              | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
index 73fb35560e51..1e1d9c7abdc7 100644
--- a/sound/soc/codecs/ak4613.c
+++ b/sound/soc/codecs/ak4613.c
@@ -870,7 +870,7 @@ static void ak4613_parse_of(struct ak4613_priv *priv,
 	 * TDM support is assuming it is probed via Audio-Graph-Card style here.
 	 * Default is SDTIx1 if it was probed via Simple-Audio-Card for now.
 	 */
-	sdti_num = of_graph_get_endpoint_count(np);
+	sdti_num = of_graph_get_device_endpoint_count(np);
 	if ((sdti_num >= SDTx_MAX) || (sdti_num < 1))
 		sdti_num = 1;
 
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 62606e20be9a..c3763719a69f 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -1104,7 +1104,7 @@ static int graph_counter(struct device_node *lnk)
 
 		/*
 		 * CPU/Codec = N:M case has many endpoints.
-		 * We can't use of_graph_get_endpoint_count() here
+		 * We can't use of_graph_get_device_endpoint_count() here
 		 */
 		while(1) {
 			port = of_get_next_child(ports, port);
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 81077d16d22f..2c89b711b1ea 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -1049,7 +1049,7 @@ static int graph_get_dai_id(struct device_node *ep)
 	 */
 	i = 0;
 	id = -1;
-	for_each_endpoint_of_node(node, endpoint) {
+	for_each_device_endpoint_of_node(node, endpoint) {
 		if (endpoint == ep)
 			id = i;
 		i++;
@@ -1093,7 +1093,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 	/* Get dai->name */
 	args.np		= node;
 	args.args[0]	= graph_get_dai_id(ep);
-	args.args_count	= (of_graph_get_endpoint_count(node) > 1);
+	args.args_count	= (of_graph_get_device_endpoint_count(node) > 1);
 
 	/*
 	 * FIXME
@@ -1122,7 +1122,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 
 parse_dai_end:
 	if (is_single_link)
-		*is_single_link = of_graph_get_endpoint_count(node) == 1;
+		*is_single_link = of_graph_get_device_endpoint_count(node) == 1;
 
 	return 0;
 }
diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index e4967540a2e1..0ebacbcddee3 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -538,7 +538,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	struct test_priv *priv;
 	int num, ret, i;
 
-	num = of_graph_get_endpoint_count(node);
+	num = of_graph_get_device_endpoint_count(node);
 	if (!num) {
 		dev_err(dev, "no port exits\n");
 		return -EINVAL;
@@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	}
 
 	i = 0;
-	for_each_endpoint_of_node(node, ep) {
+	for_each_device_endpoint_of_node(node, ep) {
 		snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i);
 		ddriv[i].name = dname[i].name;
 
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 0b1aa23c1189..d0581232063a 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1298,7 +1298,7 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
 		if (!of_node_name_eq(ports, "ports") &&
 		    !of_node_name_eq(ports, "port"))
 			continue;
-		priv->component_dais[i] = of_graph_get_endpoint_count(ports);
+		priv->component_dais[i] = of_graph_get_device_endpoint_count(ports);
 		nr += priv->component_dais[i];
 		i++;
 		if (i >= RSND_MAX_COMPONENT) {
@@ -1510,7 +1510,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
 			if (!of_node_name_eq(ports, "ports") &&
 			    !of_node_name_eq(ports, "port"))
 				continue;
-			for_each_endpoint_of_node(ports, dai_np) {
+			for_each_device_endpoint_of_node(ports, dai_np) {
 				__rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i);
 				if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) {
 					rdai = rsnd_rdai_get(priv, dai_i);
-- 
2.25.1


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

* [PATCH v3 10/24] ASoC: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

of_graph_get_next_endpoint() is now renamed to
of_graph_get_next_device_endpoint(). Switch to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/ak4613.c             | 2 +-
 sound/soc/generic/audio-graph-card2.c | 2 +-
 sound/soc/generic/simple-card-utils.c | 6 +++---
 sound/soc/generic/test-component.c    | 4 ++--
 sound/soc/sh/rcar/core.c              | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c
index 73fb35560e51..1e1d9c7abdc7 100644
--- a/sound/soc/codecs/ak4613.c
+++ b/sound/soc/codecs/ak4613.c
@@ -870,7 +870,7 @@ static void ak4613_parse_of(struct ak4613_priv *priv,
 	 * TDM support is assuming it is probed via Audio-Graph-Card style here.
 	 * Default is SDTIx1 if it was probed via Simple-Audio-Card for now.
 	 */
-	sdti_num = of_graph_get_endpoint_count(np);
+	sdti_num = of_graph_get_device_endpoint_count(np);
 	if ((sdti_num >= SDTx_MAX) || (sdti_num < 1))
 		sdti_num = 1;
 
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 62606e20be9a..c3763719a69f 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -1104,7 +1104,7 @@ static int graph_counter(struct device_node *lnk)
 
 		/*
 		 * CPU/Codec = N:M case has many endpoints.
-		 * We can't use of_graph_get_endpoint_count() here
+		 * We can't use of_graph_get_device_endpoint_count() here
 		 */
 		while(1) {
 			port = of_get_next_child(ports, port);
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 81077d16d22f..2c89b711b1ea 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -1049,7 +1049,7 @@ static int graph_get_dai_id(struct device_node *ep)
 	 */
 	i = 0;
 	id = -1;
-	for_each_endpoint_of_node(node, endpoint) {
+	for_each_device_endpoint_of_node(node, endpoint) {
 		if (endpoint == ep)
 			id = i;
 		i++;
@@ -1093,7 +1093,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 	/* Get dai->name */
 	args.np		= node;
 	args.args[0]	= graph_get_dai_id(ep);
-	args.args_count	= (of_graph_get_endpoint_count(node) > 1);
+	args.args_count	= (of_graph_get_device_endpoint_count(node) > 1);
 
 	/*
 	 * FIXME
@@ -1122,7 +1122,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
 
 parse_dai_end:
 	if (is_single_link)
-		*is_single_link = of_graph_get_endpoint_count(node) == 1;
+		*is_single_link = of_graph_get_device_endpoint_count(node) == 1;
 
 	return 0;
 }
diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index e4967540a2e1..0ebacbcddee3 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -538,7 +538,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	struct test_priv *priv;
 	int num, ret, i;
 
-	num = of_graph_get_endpoint_count(node);
+	num = of_graph_get_device_endpoint_count(node);
 	if (!num) {
 		dev_err(dev, "no port exits\n");
 		return -EINVAL;
@@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	}
 
 	i = 0;
-	for_each_endpoint_of_node(node, ep) {
+	for_each_device_endpoint_of_node(node, ep) {
 		snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i);
 		ddriv[i].name = dname[i].name;
 
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 0b1aa23c1189..d0581232063a 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1298,7 +1298,7 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
 		if (!of_node_name_eq(ports, "ports") &&
 		    !of_node_name_eq(ports, "port"))
 			continue;
-		priv->component_dais[i] = of_graph_get_endpoint_count(ports);
+		priv->component_dais[i] = of_graph_get_device_endpoint_count(ports);
 		nr += priv->component_dais[i];
 		i++;
 		if (i >= RSND_MAX_COMPONENT) {
@@ -1510,7 +1510,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv)
 			if (!of_node_name_eq(ports, "ports") &&
 			    !of_node_name_eq(ports, "port"))
 				continue;
-			for_each_endpoint_of_node(ports, dai_np) {
+			for_each_device_endpoint_of_node(ports, dai_np) {
 				__rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i);
 				if (rsnd_is_gen3(priv) || rsnd_is_gen4(priv)) {
 					rdai = rsnd_rdai_get(priv, dai_i);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 11/24] of: remove of_graph_get_next_endpoint() define
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

All driver are using new of_graph_get_next_device_endpoint(),
remove of_graph_get_next_endpoint() macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/linux/of_graph.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 80b7a579e96a..f59ce2ea55eb 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -26,11 +26,6 @@ struct of_endpoint {
 	const struct device_node *local_node;
 };
 
-/* REMOVE ME */
-#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous)
-#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child)
-#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np)
-
 /**
  * for_each_device_endpoint_of_node - iterate over every endpoint in a device node
  * @parent: parent device node containing ports and endpoints
-- 
2.25.1


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

* [PATCH v3 11/24] of: remove of_graph_get_next_endpoint() define
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

All driver are using new of_graph_get_next_device_endpoint(),
remove of_graph_get_next_endpoint() macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/linux/of_graph.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 80b7a579e96a..f59ce2ea55eb 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -26,11 +26,6 @@ struct of_endpoint {
 	const struct device_node *local_node;
 };
 
-/* REMOVE ME */
-#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous)
-#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child)
-#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np)
-
 /**
  * for_each_device_endpoint_of_node - iterate over every endpoint in a device node
  * @parent: parent device node containing ports and endpoints
-- 
2.25.1


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

* [PATCH v3 11/24] of: remove of_graph_get_next_endpoint() define
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

All driver are using new of_graph_get_next_device_endpoint(),
remove of_graph_get_next_endpoint() macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/linux/of_graph.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 80b7a579e96a..f59ce2ea55eb 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -26,11 +26,6 @@ struct of_endpoint {
 	const struct device_node *local_node;
 };
 
-/* REMOVE ME */
-#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous)
-#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child)
-#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np)
-
 /**
  * for_each_device_endpoint_of_node - iterate over every endpoint in a device node
  * @parent: parent device node containing ports and endpoints
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 12/24] of: property: add port base loop
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We have endpoint base functions
	- of_graph_get_next_device_endpoint()
	- of_graph_get_device_endpoint_count()
	- for_each_device_endpoint_of_node()

Here, for_each_device_endpoint_of_node() loop finds each endpoints

	ports {
		port@0 {
(1)			endpoint {...};
		};
		port@1 {
(2)			endpoint {...};
		};
		...
	};

In above case, for_each_device_endpoint_of_node() loop finds endpoint
as (1) -> (2) -> ...

Basically, user/driver knows which port is used for what, but not in
all cases. For example on flexible/generic driver case, how many ports
are used is not fixed.

For example Sound Generic Card driver which is used from many venders
can't know how many ports are used. Because the driver is very
flexible/generic, it is impossible to know how many ports are used,
it depends on each vender SoC and/or its used board.

And more, the port can have multi endpoints. For example Generic Sound
Card case, it supports many type of connection between CPU / Codec, and
some of them uses multi endpoint in one port.
Then, Generic Sound Card want to handle each connection via "port"
instead of "endpoint".
But, it is very difficult to handle each "port" by
for_each_device_endpoint_of_node(). Getting "port" by
using of_get_parent() from "endpoint" doesn't work. see below.

	ports {
		port@0 {
(1)			endpoint@0 {...};
(2)			endpoint@1 {...};
		};
		port@1 {
(3)			endpoint {...};
		};
		...
	};

Add "port" base functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 56 ++++++++++++++++++++++++++++++++++++++++
 include/linux/of_graph.h | 26 +++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 007729d66972..cba07d2af62b 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -631,6 +631,44 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
 }
 EXPORT_SYMBOL(of_graph_get_port_by_id);
 
+/**
+ * of_graph_get_next_port() - get next port node.
+ * @parent: pointer to the parent device node
+ * @port: current port node, or NULL to get first
+ *
+ * Return: A 'port' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is decremented.
+ */
+struct device_node *of_graph_get_next_port(const struct device_node *parent,
+					   struct device_node *port)
+{
+	if (!parent)
+		return NULL;
+
+	if (!port) {
+		struct device_node *node;
+		struct device_node *port;
+
+		node = of_get_child_by_name(parent, "ports");
+		if (node)
+			parent = node;
+
+		port = of_get_child_by_name(parent, "port");
+		of_node_put(node);
+
+		return port;
+	}
+
+	do {
+		port = of_get_next_child(parent, port);
+		if (!port)
+			break;
+	} while (!of_node_name_eq(port, "port"));
+
+	return port;
+}
+EXPORT_SYMBOL(of_graph_get_next_port);
+
 /**
  * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
  * it gets next endpoint from next port.
@@ -831,6 +869,24 @@ unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 }
 EXPORT_SYMBOL(of_graph_get_device_endpoint_count);
 
+/**
+ * of_graph_get_port_count() - get count of port
+ * @np: pointer to the parent device node
+ *
+ * Return: count of port of this device node
+ */
+unsigned int of_graph_get_port_count(const struct device_node *np)
+{
+	struct device_node *port;
+	int num = 0;
+
+	for_each_port_of_node(np, port)
+		num++;
+
+	return num;
+}
+EXPORT_SYMBOL(of_graph_get_port_count);
+
 /**
  * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
  * @node: pointer to parent device_node containing graph port/endpoint
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index f59ce2ea55eb..48f7701feab1 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -37,14 +37,28 @@ struct of_endpoint {
 	for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \
 	     child = of_graph_get_next_device_endpoint(parent, child))
 
+/**
+ * for_each_port_of_node - iterate over every port in a device node
+ * @parent: parent device node containing ports/port
+ * @child: loop variable pointing to the current port node
+ *
+ * When breaking out of the loop, of_node_put(child) has to be called manually.
+ */
+#define for_each_port_of_node(parent, child)			\
+	for (child = of_graph_get_next_port(parent, NULL); child != NULL; \
+	     child = of_graph_get_next_port(parent, child))
+
 #ifdef CONFIG_OF
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
 unsigned int of_graph_get_device_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_port_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
 						      struct device_node *previous);
+struct device_node *of_graph_get_next_port(const struct device_node *parent,
+					   struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
 struct device_node *of_graph_get_remote_endpoint(
@@ -73,6 +87,11 @@ static inline unsigned int of_graph_get_device_endpoint_count(const struct devic
 	return 0;
 }
 
+static inline unsigned int of_graph_get_port_count(const struct device_node *np)
+{
+	return 0;
+}
+
 static inline struct device_node *of_graph_get_port_by_id(
 					struct device_node *node, u32 id)
 {
@@ -86,6 +105,13 @@ static inline struct device_node *of_graph_get_next_device_endpoint(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_next_port(
+					const struct device_node *parent,
+					struct device_node *previous)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg)
 {
-- 
2.25.1


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

* [PATCH v3 12/24] of: property: add port base loop
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We have endpoint base functions
	- of_graph_get_next_device_endpoint()
	- of_graph_get_device_endpoint_count()
	- for_each_device_endpoint_of_node()

Here, for_each_device_endpoint_of_node() loop finds each endpoints

	ports {
		port@0 {
(1)			endpoint {...};
		};
		port@1 {
(2)			endpoint {...};
		};
		...
	};

In above case, for_each_device_endpoint_of_node() loop finds endpoint
as (1) -> (2) -> ...

Basically, user/driver knows which port is used for what, but not in
all cases. For example on flexible/generic driver case, how many ports
are used is not fixed.

For example Sound Generic Card driver which is used from many venders
can't know how many ports are used. Because the driver is very
flexible/generic, it is impossible to know how many ports are used,
it depends on each vender SoC and/or its used board.

And more, the port can have multi endpoints. For example Generic Sound
Card case, it supports many type of connection between CPU / Codec, and
some of them uses multi endpoint in one port.
Then, Generic Sound Card want to handle each connection via "port"
instead of "endpoint".
But, it is very difficult to handle each "port" by
for_each_device_endpoint_of_node(). Getting "port" by
using of_get_parent() from "endpoint" doesn't work. see below.

	ports {
		port@0 {
(1)			endpoint@0 {...};
(2)			endpoint@1 {...};
		};
		port@1 {
(3)			endpoint {...};
		};
		...
	};

Add "port" base functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 56 ++++++++++++++++++++++++++++++++++++++++
 include/linux/of_graph.h | 26 +++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 007729d66972..cba07d2af62b 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -631,6 +631,44 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
 }
 EXPORT_SYMBOL(of_graph_get_port_by_id);
 
+/**
+ * of_graph_get_next_port() - get next port node.
+ * @parent: pointer to the parent device node
+ * @port: current port node, or NULL to get first
+ *
+ * Return: A 'port' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is decremented.
+ */
+struct device_node *of_graph_get_next_port(const struct device_node *parent,
+					   struct device_node *port)
+{
+	if (!parent)
+		return NULL;
+
+	if (!port) {
+		struct device_node *node;
+		struct device_node *port;
+
+		node = of_get_child_by_name(parent, "ports");
+		if (node)
+			parent = node;
+
+		port = of_get_child_by_name(parent, "port");
+		of_node_put(node);
+
+		return port;
+	}
+
+	do {
+		port = of_get_next_child(parent, port);
+		if (!port)
+			break;
+	} while (!of_node_name_eq(port, "port"));
+
+	return port;
+}
+EXPORT_SYMBOL(of_graph_get_next_port);
+
 /**
  * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
  * it gets next endpoint from next port.
@@ -831,6 +869,24 @@ unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 }
 EXPORT_SYMBOL(of_graph_get_device_endpoint_count);
 
+/**
+ * of_graph_get_port_count() - get count of port
+ * @np: pointer to the parent device node
+ *
+ * Return: count of port of this device node
+ */
+unsigned int of_graph_get_port_count(const struct device_node *np)
+{
+	struct device_node *port;
+	int num = 0;
+
+	for_each_port_of_node(np, port)
+		num++;
+
+	return num;
+}
+EXPORT_SYMBOL(of_graph_get_port_count);
+
 /**
  * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
  * @node: pointer to parent device_node containing graph port/endpoint
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index f59ce2ea55eb..48f7701feab1 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -37,14 +37,28 @@ struct of_endpoint {
 	for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \
 	     child = of_graph_get_next_device_endpoint(parent, child))
 
+/**
+ * for_each_port_of_node - iterate over every port in a device node
+ * @parent: parent device node containing ports/port
+ * @child: loop variable pointing to the current port node
+ *
+ * When breaking out of the loop, of_node_put(child) has to be called manually.
+ */
+#define for_each_port_of_node(parent, child)			\
+	for (child = of_graph_get_next_port(parent, NULL); child != NULL; \
+	     child = of_graph_get_next_port(parent, child))
+
 #ifdef CONFIG_OF
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
 unsigned int of_graph_get_device_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_port_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
 						      struct device_node *previous);
+struct device_node *of_graph_get_next_port(const struct device_node *parent,
+					   struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
 struct device_node *of_graph_get_remote_endpoint(
@@ -73,6 +87,11 @@ static inline unsigned int of_graph_get_device_endpoint_count(const struct devic
 	return 0;
 }
 
+static inline unsigned int of_graph_get_port_count(const struct device_node *np)
+{
+	return 0;
+}
+
 static inline struct device_node *of_graph_get_port_by_id(
 					struct device_node *node, u32 id)
 {
@@ -86,6 +105,13 @@ static inline struct device_node *of_graph_get_next_device_endpoint(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_next_port(
+					const struct device_node *parent,
+					struct device_node *previous)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg)
 {
-- 
2.25.1


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

* [PATCH v3 12/24] of: property: add port base loop
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We have endpoint base functions
	- of_graph_get_next_device_endpoint()
	- of_graph_get_device_endpoint_count()
	- for_each_device_endpoint_of_node()

Here, for_each_device_endpoint_of_node() loop finds each endpoints

	ports {
		port@0 {
(1)			endpoint {...};
		};
		port@1 {
(2)			endpoint {...};
		};
		...
	};

In above case, for_each_device_endpoint_of_node() loop finds endpoint
as (1) -> (2) -> ...

Basically, user/driver knows which port is used for what, but not in
all cases. For example on flexible/generic driver case, how many ports
are used is not fixed.

For example Sound Generic Card driver which is used from many venders
can't know how many ports are used. Because the driver is very
flexible/generic, it is impossible to know how many ports are used,
it depends on each vender SoC and/or its used board.

And more, the port can have multi endpoints. For example Generic Sound
Card case, it supports many type of connection between CPU / Codec, and
some of them uses multi endpoint in one port.
Then, Generic Sound Card want to handle each connection via "port"
instead of "endpoint".
But, it is very difficult to handle each "port" by
for_each_device_endpoint_of_node(). Getting "port" by
using of_get_parent() from "endpoint" doesn't work. see below.

	ports {
		port@0 {
(1)			endpoint@0 {...};
(2)			endpoint@1 {...};
		};
		port@1 {
(3)			endpoint {...};
		};
		...
	};

Add "port" base functions.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 56 ++++++++++++++++++++++++++++++++++++++++
 include/linux/of_graph.h | 26 +++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 007729d66972..cba07d2af62b 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -631,6 +631,44 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id)
 }
 EXPORT_SYMBOL(of_graph_get_port_by_id);
 
+/**
+ * of_graph_get_next_port() - get next port node.
+ * @parent: pointer to the parent device node
+ * @port: current port node, or NULL to get first
+ *
+ * Return: A 'port' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is decremented.
+ */
+struct device_node *of_graph_get_next_port(const struct device_node *parent,
+					   struct device_node *port)
+{
+	if (!parent)
+		return NULL;
+
+	if (!port) {
+		struct device_node *node;
+		struct device_node *port;
+
+		node = of_get_child_by_name(parent, "ports");
+		if (node)
+			parent = node;
+
+		port = of_get_child_by_name(parent, "port");
+		of_node_put(node);
+
+		return port;
+	}
+
+	do {
+		port = of_get_next_child(parent, port);
+		if (!port)
+			break;
+	} while (!of_node_name_eq(port, "port"));
+
+	return port;
+}
+EXPORT_SYMBOL(of_graph_get_next_port);
+
 /**
  * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
  * it gets next endpoint from next port.
@@ -831,6 +869,24 @@ unsigned int of_graph_get_device_endpoint_count(const struct device_node *np)
 }
 EXPORT_SYMBOL(of_graph_get_device_endpoint_count);
 
+/**
+ * of_graph_get_port_count() - get count of port
+ * @np: pointer to the parent device node
+ *
+ * Return: count of port of this device node
+ */
+unsigned int of_graph_get_port_count(const struct device_node *np)
+{
+	struct device_node *port;
+	int num = 0;
+
+	for_each_port_of_node(np, port)
+		num++;
+
+	return num;
+}
+EXPORT_SYMBOL(of_graph_get_port_count);
+
 /**
  * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint
  * @node: pointer to parent device_node containing graph port/endpoint
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index f59ce2ea55eb..48f7701feab1 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -37,14 +37,28 @@ struct of_endpoint {
 	for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \
 	     child = of_graph_get_next_device_endpoint(parent, child))
 
+/**
+ * for_each_port_of_node - iterate over every port in a device node
+ * @parent: parent device node containing ports/port
+ * @child: loop variable pointing to the current port node
+ *
+ * When breaking out of the loop, of_node_put(child) has to be called manually.
+ */
+#define for_each_port_of_node(parent, child)			\
+	for (child = of_graph_get_next_port(parent, NULL); child != NULL; \
+	     child = of_graph_get_next_port(parent, child))
+
 #ifdef CONFIG_OF
 bool of_graph_is_present(const struct device_node *node);
 int of_graph_parse_endpoint(const struct device_node *node,
 				struct of_endpoint *endpoint);
 unsigned int of_graph_get_device_endpoint_count(const struct device_node *np);
+unsigned int of_graph_get_port_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
 						      struct device_node *previous);
+struct device_node *of_graph_get_next_port(const struct device_node *parent,
+					   struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg);
 struct device_node *of_graph_get_remote_endpoint(
@@ -73,6 +87,11 @@ static inline unsigned int of_graph_get_device_endpoint_count(const struct devic
 	return 0;
 }
 
+static inline unsigned int of_graph_get_port_count(const struct device_node *np)
+{
+	return 0;
+}
+
 static inline struct device_node *of_graph_get_port_by_id(
 					struct device_node *node, u32 id)
 {
@@ -86,6 +105,13 @@ static inline struct device_node *of_graph_get_next_device_endpoint(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_next_port(
+					const struct device_node *parent,
+					struct device_node *previous)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_endpoint_by_regs(
 		const struct device_node *parent, int port_reg, int reg)
 {
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 13/24] of: property: use of_graph_get_next_port() on of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We have of_graph_get_next_port(), use it on of_graph_get_next_endpoint().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 drivers/of/property.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index cba07d2af62b..083f92513f5e 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -694,15 +694,7 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 	 * parent port node.
 	 */
 	if (!prev) {
-		struct device_node *node;
-
-		node = of_get_child_by_name(parent, "ports");
-		if (node)
-			parent = node;
-
-		port = of_get_child_by_name(parent, "port");
-		of_node_put(node);
-
+		port = of_graph_get_next_port(parent, NULL);
 		if (!port) {
 			pr_err("graph: no port node found in %pOF\n", parent);
 			return NULL;
@@ -729,11 +721,9 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 		/* No more endpoints under this port, try the next one. */
 		prev = NULL;
 
-		do {
-			port = of_get_next_child(parent, port);
-			if (!port)
-				return NULL;
-		} while (!of_node_name_eq(port, "port"));
+		port = of_graph_get_next_port(parent, port);
+		if (!port)
+			return NULL;
 	}
 }
 EXPORT_SYMBOL(of_graph_get_next_device_endpoint);
-- 
2.25.1


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

* [PATCH v3 13/24] of: property: use of_graph_get_next_port() on of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We have of_graph_get_next_port(), use it on of_graph_get_next_endpoint().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 drivers/of/property.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index cba07d2af62b..083f92513f5e 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -694,15 +694,7 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 	 * parent port node.
 	 */
 	if (!prev) {
-		struct device_node *node;
-
-		node = of_get_child_by_name(parent, "ports");
-		if (node)
-			parent = node;
-
-		port = of_get_child_by_name(parent, "port");
-		of_node_put(node);
-
+		port = of_graph_get_next_port(parent, NULL);
 		if (!port) {
 			pr_err("graph: no port node found in %pOF\n", parent);
 			return NULL;
@@ -729,11 +721,9 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 		/* No more endpoints under this port, try the next one. */
 		prev = NULL;
 
-		do {
-			port = of_get_next_child(parent, port);
-			if (!port)
-				return NULL;
-		} while (!of_node_name_eq(port, "port"));
+		port = of_graph_get_next_port(parent, port);
+		if (!port)
+			return NULL;
 	}
 }
 EXPORT_SYMBOL(of_graph_get_next_device_endpoint);
-- 
2.25.1


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

* [PATCH v3 13/24] of: property: use of_graph_get_next_port() on of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We have of_graph_get_next_port(), use it on of_graph_get_next_endpoint().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 drivers/of/property.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index cba07d2af62b..083f92513f5e 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -694,15 +694,7 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 	 * parent port node.
 	 */
 	if (!prev) {
-		struct device_node *node;
-
-		node = of_get_child_by_name(parent, "ports");
-		if (node)
-			parent = node;
-
-		port = of_get_child_by_name(parent, "port");
-		of_node_put(node);
-
+		port = of_graph_get_next_port(parent, NULL);
 		if (!port) {
 			pr_err("graph: no port node found in %pOF\n", parent);
 			return NULL;
@@ -729,11 +721,9 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 		/* No more endpoints under this port, try the next one. */
 		prev = NULL;
 
-		do {
-			port = of_get_next_child(parent, port);
-			if (!port)
-				return NULL;
-		} while (!of_node_name_eq(port, "port"));
+		port = of_graph_get_next_port(parent, port);
+		if (!port)
+			return NULL;
 	}
 }
 EXPORT_SYMBOL(of_graph_get_next_device_endpoint);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We already have of_graph_get_next_device_endpoint(), but it is not
intuitive to use.

(X)	node {
(Y)		ports {
			port@0 { endpoint { remote-endpoint = ...; };};
(A1)			port@1 { endpoint { remote-endpoint = ...; };
(A2)				 endpoint { remote-endpoint = ...; };};
(B)			port@2 { endpoint { remote-endpoint = ...; };};
		};
	};

For example, if I want to handle port@1's 2 endpoints (= A1, A2),
I want to use like below

	A1 = of_graph_get_next_device_endpoint(port1, NULL);
	A2 = of_graph_get_next_device_endpoint(port1, A1);

But 1st one will be error, because of_graph_get_next_device_endpoint()
requested "parent" means "node" (X) or "ports" (Y), not "port".
Below are OK

	/* These will be node/ports/port@0/endpoint */
	of_graph_get_next_device_endpoint(node,  NULL);
	of_graph_get_next_device_endpoint(ports, NULL);

In other words, we can't handle A1/A2 directly via
of_graph_get_next_device_endpoint() so far.

There is another non intuitive behavior on
of_graph_get_next_device_endpoint(). In case of if I could get A1 pointer
for some way, and if I want to handle port@1 things, I would like use
it like below

	/*
	 * "ep" is now A1, and handle port1 things here,
	 * but we don't know how many endpoints port1 has.
	 *
	 * Because "ep" is non NULL, we can use port1
	 * as of_graph_get_next_device_endpoint(port1, xxx)
	 */
	do {
		/* do something for port1 specific things here */
	} while (ep = of_graph_get_next_device_endpoint(port1, ep))

But it also not worked as I expected.
I expect it will be A1 -> A2 -> NULL,
but      it will be A1 -> A2 -> B,    because
of_graph_get_next_device_endpoint() will fetch endpoint beyond the port.

It is not useful on generic driver like Generic Sound Card.
It uses of_get_next_child() instead for now, but it is not intuitive,
and not check node name (= "endpoint").

To handle endpoint more intuitive, create of_graph_get_next_endpoint()

	of_graph_get_next_endpoint(port1, NULL); // A1
	of_graph_get_next_endpoint(port1, A1);   // A2
	of_graph_get_next_endpoint(port1, A2);   // NULL

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 24 +++++++++++++++++++++++-
 include/linux/of_graph.h |  9 +++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 083f92513f5e..ff37fd5194c1 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -669,6 +669,28 @@ struct device_node *of_graph_get_next_port(const struct device_node *parent,
 }
 EXPORT_SYMBOL(of_graph_get_next_port);
 
+/**
+ * of_graph_get_next_endpoint() - get next endpoint node. If it reached to end of the port,
+ * it will return NULL.
+ * @port: pointer to the target port node
+ * @endpoint: current endpoint node, or NULL to get first
+ *
+ * Return: An 'endpoint' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is decremented.
+ */
+struct device_node *of_graph_get_next_endpoint(const struct device_node *port,
+					       struct device_node *endpoint)
+{
+	do {
+		endpoint = of_get_next_child(port, endpoint);
+		if (!endpoint)
+			break;
+	} while (!of_node_name_eq(endpoint, "endpoint"));
+
+	return endpoint;
+}
+EXPORT_SYMBOL(of_graph_get_next_endpoint);
+
 /**
  * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
  * it gets next endpoint from next port.
@@ -712,7 +734,7 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 		 * getting the next child. If the previous endpoint is NULL this
 		 * will return the first child.
 		 */
-		endpoint = of_get_next_child(port, prev);
+		endpoint = of_graph_get_next_endpoint(port, prev);
 		if (endpoint) {
 			of_node_put(port);
 			return endpoint;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 48f7701feab1..ee4b219594f1 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -57,6 +57,8 @@ unsigned int of_graph_get_port_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
 						      struct device_node *previous);
+struct device_node *of_graph_get_next_endpoint(const struct device_node *port,
+					       struct device_node *prev);
 struct device_node *of_graph_get_next_port(const struct device_node *parent,
 					   struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
@@ -105,6 +107,13 @@ static inline struct device_node *of_graph_get_next_device_endpoint(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_next_endpoint(
+					const struct device_node *parent,
+					struct device_node *previous)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_next_port(
 					const struct device_node *parent,
 					struct device_node *previous)
-- 
2.25.1


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

* [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We already have of_graph_get_next_device_endpoint(), but it is not
intuitive to use.

(X)	node {
(Y)		ports {
			port@0 { endpoint { remote-endpoint = ...; };};
(A1)			port@1 { endpoint { remote-endpoint = ...; };
(A2)				 endpoint { remote-endpoint = ...; };};
(B)			port@2 { endpoint { remote-endpoint = ...; };};
		};
	};

For example, if I want to handle port@1's 2 endpoints (= A1, A2),
I want to use like below

	A1 = of_graph_get_next_device_endpoint(port1, NULL);
	A2 = of_graph_get_next_device_endpoint(port1, A1);

But 1st one will be error, because of_graph_get_next_device_endpoint()
requested "parent" means "node" (X) or "ports" (Y), not "port".
Below are OK

	/* These will be node/ports/port@0/endpoint */
	of_graph_get_next_device_endpoint(node,  NULL);
	of_graph_get_next_device_endpoint(ports, NULL);

In other words, we can't handle A1/A2 directly via
of_graph_get_next_device_endpoint() so far.

There is another non intuitive behavior on
of_graph_get_next_device_endpoint(). In case of if I could get A1 pointer
for some way, and if I want to handle port@1 things, I would like use
it like below

	/*
	 * "ep" is now A1, and handle port1 things here,
	 * but we don't know how many endpoints port1 has.
	 *
	 * Because "ep" is non NULL, we can use port1
	 * as of_graph_get_next_device_endpoint(port1, xxx)
	 */
	do {
		/* do something for port1 specific things here */
	} while (ep = of_graph_get_next_device_endpoint(port1, ep))

But it also not worked as I expected.
I expect it will be A1 -> A2 -> NULL,
but      it will be A1 -> A2 -> B,    because
of_graph_get_next_device_endpoint() will fetch endpoint beyond the port.

It is not useful on generic driver like Generic Sound Card.
It uses of_get_next_child() instead for now, but it is not intuitive,
and not check node name (= "endpoint").

To handle endpoint more intuitive, create of_graph_get_next_endpoint()

	of_graph_get_next_endpoint(port1, NULL); // A1
	of_graph_get_next_endpoint(port1, A1);   // A2
	of_graph_get_next_endpoint(port1, A2);   // NULL

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 24 +++++++++++++++++++++++-
 include/linux/of_graph.h |  9 +++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 083f92513f5e..ff37fd5194c1 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -669,6 +669,28 @@ struct device_node *of_graph_get_next_port(const struct device_node *parent,
 }
 EXPORT_SYMBOL(of_graph_get_next_port);
 
+/**
+ * of_graph_get_next_endpoint() - get next endpoint node. If it reached to end of the port,
+ * it will return NULL.
+ * @port: pointer to the target port node
+ * @endpoint: current endpoint node, or NULL to get first
+ *
+ * Return: An 'endpoint' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is decremented.
+ */
+struct device_node *of_graph_get_next_endpoint(const struct device_node *port,
+					       struct device_node *endpoint)
+{
+	do {
+		endpoint = of_get_next_child(port, endpoint);
+		if (!endpoint)
+			break;
+	} while (!of_node_name_eq(endpoint, "endpoint"));
+
+	return endpoint;
+}
+EXPORT_SYMBOL(of_graph_get_next_endpoint);
+
 /**
  * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
  * it gets next endpoint from next port.
@@ -712,7 +734,7 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 		 * getting the next child. If the previous endpoint is NULL this
 		 * will return the first child.
 		 */
-		endpoint = of_get_next_child(port, prev);
+		endpoint = of_graph_get_next_endpoint(port, prev);
 		if (endpoint) {
 			of_node_put(port);
 			return endpoint;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 48f7701feab1..ee4b219594f1 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -57,6 +57,8 @@ unsigned int of_graph_get_port_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
 						      struct device_node *previous);
+struct device_node *of_graph_get_next_endpoint(const struct device_node *port,
+					       struct device_node *prev);
 struct device_node *of_graph_get_next_port(const struct device_node *parent,
 					   struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
@@ -105,6 +107,13 @@ static inline struct device_node *of_graph_get_next_device_endpoint(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_next_endpoint(
+					const struct device_node *parent,
+					struct device_node *previous)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_next_port(
 					const struct device_node *parent,
 					struct device_node *previous)
-- 
2.25.1


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

* [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We already have of_graph_get_next_device_endpoint(), but it is not
intuitive to use.

(X)	node {
(Y)		ports {
			port@0 { endpoint { remote-endpoint = ...; };};
(A1)			port@1 { endpoint { remote-endpoint = ...; };
(A2)				 endpoint { remote-endpoint = ...; };};
(B)			port@2 { endpoint { remote-endpoint = ...; };};
		};
	};

For example, if I want to handle port@1's 2 endpoints (= A1, A2),
I want to use like below

	A1 = of_graph_get_next_device_endpoint(port1, NULL);
	A2 = of_graph_get_next_device_endpoint(port1, A1);

But 1st one will be error, because of_graph_get_next_device_endpoint()
requested "parent" means "node" (X) or "ports" (Y), not "port".
Below are OK

	/* These will be node/ports/port@0/endpoint */
	of_graph_get_next_device_endpoint(node,  NULL);
	of_graph_get_next_device_endpoint(ports, NULL);

In other words, we can't handle A1/A2 directly via
of_graph_get_next_device_endpoint() so far.

There is another non intuitive behavior on
of_graph_get_next_device_endpoint(). In case of if I could get A1 pointer
for some way, and if I want to handle port@1 things, I would like use
it like below

	/*
	 * "ep" is now A1, and handle port1 things here,
	 * but we don't know how many endpoints port1 has.
	 *
	 * Because "ep" is non NULL, we can use port1
	 * as of_graph_get_next_device_endpoint(port1, xxx)
	 */
	do {
		/* do something for port1 specific things here */
	} while (ep = of_graph_get_next_device_endpoint(port1, ep))

But it also not worked as I expected.
I expect it will be A1 -> A2 -> NULL,
but      it will be A1 -> A2 -> B,    because
of_graph_get_next_device_endpoint() will fetch endpoint beyond the port.

It is not useful on generic driver like Generic Sound Card.
It uses of_get_next_child() instead for now, but it is not intuitive,
and not check node name (= "endpoint").

To handle endpoint more intuitive, create of_graph_get_next_endpoint()

	of_graph_get_next_endpoint(port1, NULL); // A1
	of_graph_get_next_endpoint(port1, A1);   // A2
	of_graph_get_next_endpoint(port1, A2);   // NULL

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/of/property.c    | 24 +++++++++++++++++++++++-
 include/linux/of_graph.h |  9 +++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/of/property.c b/drivers/of/property.c
index 083f92513f5e..ff37fd5194c1 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -669,6 +669,28 @@ struct device_node *of_graph_get_next_port(const struct device_node *parent,
 }
 EXPORT_SYMBOL(of_graph_get_next_port);
 
+/**
+ * of_graph_get_next_endpoint() - get next endpoint node. If it reached to end of the port,
+ * it will return NULL.
+ * @port: pointer to the target port node
+ * @endpoint: current endpoint node, or NULL to get first
+ *
+ * Return: An 'endpoint' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is decremented.
+ */
+struct device_node *of_graph_get_next_endpoint(const struct device_node *port,
+					       struct device_node *endpoint)
+{
+	do {
+		endpoint = of_get_next_child(port, endpoint);
+		if (!endpoint)
+			break;
+	} while (!of_node_name_eq(endpoint, "endpoint"));
+
+	return endpoint;
+}
+EXPORT_SYMBOL(of_graph_get_next_endpoint);
+
 /**
  * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port,
  * it gets next endpoint from next port.
@@ -712,7 +734,7 @@ struct device_node *of_graph_get_next_device_endpoint(const struct device_node *
 		 * getting the next child. If the previous endpoint is NULL this
 		 * will return the first child.
 		 */
-		endpoint = of_get_next_child(port, prev);
+		endpoint = of_graph_get_next_endpoint(port, prev);
 		if (endpoint) {
 			of_node_put(port);
 			return endpoint;
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
index 48f7701feab1..ee4b219594f1 100644
--- a/include/linux/of_graph.h
+++ b/include/linux/of_graph.h
@@ -57,6 +57,8 @@ unsigned int of_graph_get_port_count(const struct device_node *np);
 struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
 struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent,
 						      struct device_node *previous);
+struct device_node *of_graph_get_next_endpoint(const struct device_node *port,
+					       struct device_node *prev);
 struct device_node *of_graph_get_next_port(const struct device_node *parent,
 					   struct device_node *previous);
 struct device_node *of_graph_get_endpoint_by_regs(
@@ -105,6 +107,13 @@ static inline struct device_node *of_graph_get_next_device_endpoint(
 	return NULL;
 }
 
+static inline struct device_node *of_graph_get_next_endpoint(
+					const struct device_node *parent,
+					struct device_node *previous)
+{
+	return NULL;
+}
+
 static inline struct device_node *of_graph_get_next_port(
 					const struct device_node *parent,
 					struct device_node *previous)
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 15/24] drm: omapdrm: use of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 030f997eccd0..74d240aa35a6 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -709,7 +709,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_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..6155e99e64f6 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -346,7 +346,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_endpoint(port, NULL);
 	if (!ep) {
 		r = 0;
 		goto err_free;
-- 
2.25.1


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

* [PATCH v3 15/24] drm: omapdrm: use of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 030f997eccd0..74d240aa35a6 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -709,7 +709,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_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..6155e99e64f6 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -346,7 +346,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_endpoint(port, NULL);
 	if (!ep) {
 		r = 0;
 		goto err_free;
-- 
2.25.1


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

* [PATCH v3 15/24] drm: omapdrm: use of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +-
 drivers/gpu/drm/omapdrm/dss/sdi.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 030f997eccd0..74d240aa35a6 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -709,7 +709,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_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..6155e99e64f6 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -346,7 +346,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_endpoint(port, NULL);
 	if (!ep) {
 		r = 0;
 		goto err_free;
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 16/24] media: xilinx-tpg: use of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/platform/xilinx/xilinx-tpg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c
index 80353ca44402..53c4e1ddf867 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -13,6 +13,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/xilinx-v4l2-controls.h>
 
@@ -745,7 +746,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
 		}
 
 		if (nports == 0) {
-			endpoint = of_get_next_child(port, NULL);
+			endpoint = of_graph_get_next_endpoint(port, NULL);
 			if (endpoint)
 				has_endpoint = true;
 			of_node_put(endpoint);
-- 
2.25.1


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

* [PATCH v3 16/24] media: xilinx-tpg: use of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/platform/xilinx/xilinx-tpg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c
index 80353ca44402..53c4e1ddf867 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -13,6 +13,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/xilinx-v4l2-controls.h>
 
@@ -745,7 +746,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
 		}
 
 		if (nports == 0) {
-			endpoint = of_get_next_child(port, NULL);
+			endpoint = of_graph_get_next_endpoint(port, NULL);
 			if (endpoint)
 				has_endpoint = true;
 			of_node_put(endpoint);
-- 
2.25.1


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

* [PATCH v3 16/24] media: xilinx-tpg: use of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/media/platform/xilinx/xilinx-tpg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c
index 80353ca44402..53c4e1ddf867 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -13,6 +13,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/platform_device.h>
 #include <linux/xilinx-v4l2-controls.h>
 
@@ -745,7 +746,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
 		}
 
 		if (nports == 0) {
-			endpoint = of_get_next_child(port, NULL);
+			endpoint = of_graph_get_next_endpoint(port, NULL);
 			if (endpoint)
 				has_endpoint = true;
 			of_node_put(endpoint);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 17/24] ASoC: audio-graph-card: use of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:06   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 83e3ba773fbd..864f014a497c 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -344,7 +344,7 @@ static int __graph_for_each_link(struct simple_util_priv *priv,
 
 		/* loop for all CPU endpoint */
 		while (1) {
-			cpu_ep = of_get_next_child(cpu_port, cpu_ep);
+			cpu_ep = of_graph_get_next_endpoint(cpu_port, cpu_ep);
 			if (!cpu_ep)
 				break;
 
-- 
2.25.1


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

* [PATCH v3 17/24] ASoC: audio-graph-card: use of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 83e3ba773fbd..864f014a497c 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -344,7 +344,7 @@ static int __graph_for_each_link(struct simple_util_priv *priv,
 
 		/* loop for all CPU endpoint */
 		while (1) {
-			cpu_ep = of_get_next_child(cpu_port, cpu_ep);
+			cpu_ep = of_graph_get_next_endpoint(cpu_port, cpu_ep);
 			if (!cpu_ep)
 				break;
 
-- 
2.25.1


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

* [PATCH v3 17/24] ASoC: audio-graph-card: use of_graph_get_next_endpoint()
@ 2024-01-31  5:06   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:06 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 83e3ba773fbd..864f014a497c 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -344,7 +344,7 @@ static int __graph_for_each_link(struct simple_util_priv *priv,
 
 		/* loop for all CPU endpoint */
 		while (1) {
-			cpu_ep = of_get_next_child(cpu_port, cpu_ep);
+			cpu_ep = of_graph_get_next_endpoint(cpu_port, cpu_ep);
 			if (!cpu_ep)
 				break;
 
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 18/24] ASoC: audio-graph-card2: use of_graph_get_next_port()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Now we can use of_graph_get_next_port() for port parsing.
Use it on audio-graph-card2 driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 29 ++++++++-------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index c3763719a69f..b2bd5b70a712 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -339,12 +339,7 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port)
 	 *	port@1 { rep1 };
 	 * };
 	 */
-	do {
-		*port = of_get_next_child(ports, *port);
-		if (!*port)
-			break;
-	} while (!of_node_name_eq(*port, "port"));
-
+	*port = of_graph_get_next_port(ports, *port);
 	if (*port) {
 		ep  = port_to_endpoint(*port);
 		rep = of_graph_get_remote_endpoint(ep);
@@ -539,7 +534,8 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 	 */
 	struct device_node *mcpu_ep		= port_to_endpoint(mcpu_port);
 	struct device_node *mcpu_ep_n		= mcpu_ep;
-	struct device_node *mcpu_port_top	= of_get_next_child(of_get_parent(mcpu_port), NULL);
+	struct device_node *mcpu_ports		= of_get_parent(mcpu_port);
+	struct device_node *mcpu_port_top	= of_graph_get_next_port(mcpu_ports, NULL);
 	struct device_node *mcpu_ep_top		= port_to_endpoint(mcpu_port_top);
 	struct device_node *mcodec_ep_top	= of_graph_get_remote_endpoint(mcpu_ep_top);
 	struct device_node *mcodec_port_top	= of_get_parent(mcodec_ep_top);
@@ -572,12 +568,12 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 			goto mcpu_err;
 
 		codec_idx = 0;
-		mcodec_port_i = of_get_next_child(mcodec_ports, NULL);
+		mcodec_port_i = of_graph_get_next_port(mcodec_ports, NULL);
 		while (1) {
 			if (codec_idx > dai_link->num_codecs)
 				goto mcodec_err;
 
-			mcodec_port_i = of_get_next_child(mcodec_ports, mcodec_port_i);
+			mcodec_port_i = of_graph_get_next_port(mcodec_ports, mcodec_port_i);
 
 			if (!mcodec_port_i)
 				goto mcodec_err;
@@ -967,7 +963,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv,
 	of_node_get(lnk);
 	port0 = lnk;
 	ports = of_get_parent(port0);
-	port1 = of_get_next_child(ports, lnk);
+	port1 = of_graph_get_next_port(ports, port0);
 
 	/*
 	 * Card2 can use original Codec2Codec settings if DT has.
@@ -1099,21 +1095,12 @@ static int graph_counter(struct device_node *lnk)
 	 */
 	if (graph_lnk_is_multi(lnk)) {
 		struct device_node *ports = of_get_parent(lnk);
-		struct device_node *port = NULL;
-		int cnt = 0;
 
 		/*
 		 * CPU/Codec = N:M case has many endpoints.
 		 * We can't use of_graph_get_device_endpoint_count() here
 		 */
-		while(1) {
-			port = of_get_next_child(ports, port);
-			if (!port)
-				break;
-			cnt++;
-		}
-
-		return cnt - 1;
+		return of_graph_get_port_count(ports) - 1;
 	}
 	/*
 	 * Single CPU / Codec
@@ -1197,7 +1184,7 @@ static int graph_count_c2c(struct simple_util_priv *priv,
 {
 	struct device_node *ports = of_get_parent(lnk);
 	struct device_node *port0 = lnk;
-	struct device_node *port1 = of_get_next_child(ports, lnk);
+	struct device_node *port1 = of_graph_get_next_port(ports, port0);
 	struct device_node *ep0 = port_to_endpoint(port0);
 	struct device_node *ep1 = port_to_endpoint(port1);
 	struct device_node *codec0 = of_graph_get_remote_port(ep0);
-- 
2.25.1


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

* [PATCH v3 18/24] ASoC: audio-graph-card2: use of_graph_get_next_port()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

Now we can use of_graph_get_next_port() for port parsing.
Use it on audio-graph-card2 driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 29 ++++++++-------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index c3763719a69f..b2bd5b70a712 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -339,12 +339,7 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port)
 	 *	port@1 { rep1 };
 	 * };
 	 */
-	do {
-		*port = of_get_next_child(ports, *port);
-		if (!*port)
-			break;
-	} while (!of_node_name_eq(*port, "port"));
-
+	*port = of_graph_get_next_port(ports, *port);
 	if (*port) {
 		ep  = port_to_endpoint(*port);
 		rep = of_graph_get_remote_endpoint(ep);
@@ -539,7 +534,8 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 	 */
 	struct device_node *mcpu_ep		= port_to_endpoint(mcpu_port);
 	struct device_node *mcpu_ep_n		= mcpu_ep;
-	struct device_node *mcpu_port_top	= of_get_next_child(of_get_parent(mcpu_port), NULL);
+	struct device_node *mcpu_ports		= of_get_parent(mcpu_port);
+	struct device_node *mcpu_port_top	= of_graph_get_next_port(mcpu_ports, NULL);
 	struct device_node *mcpu_ep_top		= port_to_endpoint(mcpu_port_top);
 	struct device_node *mcodec_ep_top	= of_graph_get_remote_endpoint(mcpu_ep_top);
 	struct device_node *mcodec_port_top	= of_get_parent(mcodec_ep_top);
@@ -572,12 +568,12 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 			goto mcpu_err;
 
 		codec_idx = 0;
-		mcodec_port_i = of_get_next_child(mcodec_ports, NULL);
+		mcodec_port_i = of_graph_get_next_port(mcodec_ports, NULL);
 		while (1) {
 			if (codec_idx > dai_link->num_codecs)
 				goto mcodec_err;
 
-			mcodec_port_i = of_get_next_child(mcodec_ports, mcodec_port_i);
+			mcodec_port_i = of_graph_get_next_port(mcodec_ports, mcodec_port_i);
 
 			if (!mcodec_port_i)
 				goto mcodec_err;
@@ -967,7 +963,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv,
 	of_node_get(lnk);
 	port0 = lnk;
 	ports = of_get_parent(port0);
-	port1 = of_get_next_child(ports, lnk);
+	port1 = of_graph_get_next_port(ports, port0);
 
 	/*
 	 * Card2 can use original Codec2Codec settings if DT has.
@@ -1099,21 +1095,12 @@ static int graph_counter(struct device_node *lnk)
 	 */
 	if (graph_lnk_is_multi(lnk)) {
 		struct device_node *ports = of_get_parent(lnk);
-		struct device_node *port = NULL;
-		int cnt = 0;
 
 		/*
 		 * CPU/Codec = N:M case has many endpoints.
 		 * We can't use of_graph_get_device_endpoint_count() here
 		 */
-		while(1) {
-			port = of_get_next_child(ports, port);
-			if (!port)
-				break;
-			cnt++;
-		}
-
-		return cnt - 1;
+		return of_graph_get_port_count(ports) - 1;
 	}
 	/*
 	 * Single CPU / Codec
@@ -1197,7 +1184,7 @@ static int graph_count_c2c(struct simple_util_priv *priv,
 {
 	struct device_node *ports = of_get_parent(lnk);
 	struct device_node *port0 = lnk;
-	struct device_node *port1 = of_get_next_child(ports, lnk);
+	struct device_node *port1 = of_graph_get_next_port(ports, port0);
 	struct device_node *ep0 = port_to_endpoint(port0);
 	struct device_node *ep1 = port_to_endpoint(port1);
 	struct device_node *codec0 = of_graph_get_remote_port(ep0);
-- 
2.25.1


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

* [PATCH v3 18/24] ASoC: audio-graph-card2: use of_graph_get_next_port()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Now we can use of_graph_get_next_port() for port parsing.
Use it on audio-graph-card2 driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 29 ++++++++-------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index c3763719a69f..b2bd5b70a712 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -339,12 +339,7 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port)
 	 *	port@1 { rep1 };
 	 * };
 	 */
-	do {
-		*port = of_get_next_child(ports, *port);
-		if (!*port)
-			break;
-	} while (!of_node_name_eq(*port, "port"));
-
+	*port = of_graph_get_next_port(ports, *port);
 	if (*port) {
 		ep  = port_to_endpoint(*port);
 		rep = of_graph_get_remote_endpoint(ep);
@@ -539,7 +534,8 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 	 */
 	struct device_node *mcpu_ep		= port_to_endpoint(mcpu_port);
 	struct device_node *mcpu_ep_n		= mcpu_ep;
-	struct device_node *mcpu_port_top	= of_get_next_child(of_get_parent(mcpu_port), NULL);
+	struct device_node *mcpu_ports		= of_get_parent(mcpu_port);
+	struct device_node *mcpu_port_top	= of_graph_get_next_port(mcpu_ports, NULL);
 	struct device_node *mcpu_ep_top		= port_to_endpoint(mcpu_port_top);
 	struct device_node *mcodec_ep_top	= of_graph_get_remote_endpoint(mcpu_ep_top);
 	struct device_node *mcodec_port_top	= of_get_parent(mcodec_ep_top);
@@ -572,12 +568,12 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 			goto mcpu_err;
 
 		codec_idx = 0;
-		mcodec_port_i = of_get_next_child(mcodec_ports, NULL);
+		mcodec_port_i = of_graph_get_next_port(mcodec_ports, NULL);
 		while (1) {
 			if (codec_idx > dai_link->num_codecs)
 				goto mcodec_err;
 
-			mcodec_port_i = of_get_next_child(mcodec_ports, mcodec_port_i);
+			mcodec_port_i = of_graph_get_next_port(mcodec_ports, mcodec_port_i);
 
 			if (!mcodec_port_i)
 				goto mcodec_err;
@@ -967,7 +963,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv,
 	of_node_get(lnk);
 	port0 = lnk;
 	ports = of_get_parent(port0);
-	port1 = of_get_next_child(ports, lnk);
+	port1 = of_graph_get_next_port(ports, port0);
 
 	/*
 	 * Card2 can use original Codec2Codec settings if DT has.
@@ -1099,21 +1095,12 @@ static int graph_counter(struct device_node *lnk)
 	 */
 	if (graph_lnk_is_multi(lnk)) {
 		struct device_node *ports = of_get_parent(lnk);
-		struct device_node *port = NULL;
-		int cnt = 0;
 
 		/*
 		 * CPU/Codec = N:M case has many endpoints.
 		 * We can't use of_graph_get_device_endpoint_count() here
 		 */
-		while(1) {
-			port = of_get_next_child(ports, port);
-			if (!port)
-				break;
-			cnt++;
-		}
-
-		return cnt - 1;
+		return of_graph_get_port_count(ports) - 1;
 	}
 	/*
 	 * Single CPU / Codec
@@ -1197,7 +1184,7 @@ static int graph_count_c2c(struct simple_util_priv *priv,
 {
 	struct device_node *ports = of_get_parent(lnk);
 	struct device_node *port0 = lnk;
-	struct device_node *port1 = of_get_next_child(ports, lnk);
+	struct device_node *port1 = of_graph_get_next_port(ports, port0);
 	struct device_node *ep0 = port_to_endpoint(port0);
 	struct device_node *ep1 = port_to_endpoint(port1);
 	struct device_node *codec0 = of_graph_get_remote_port(ep0);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 19/24] ASoC: audio-graph-card2: use of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index b2bd5b70a712..70f34e920423 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -555,7 +555,7 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 		if (*nm_idx > nm_max)
 			break;
 
-		mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n);
+		mcpu_ep_n = of_graph_get_next_endpoint(mcpu_port, mcpu_ep_n);
 		if (!mcpu_ep_n) {
 			ret = 0;
 			break;
-- 
2.25.1


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

* [PATCH v3 19/24] ASoC: audio-graph-card2: use of_graph_get_next_endpoint()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index b2bd5b70a712..70f34e920423 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -555,7 +555,7 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 		if (*nm_idx > nm_max)
 			break;
 
-		mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n);
+		mcpu_ep_n = of_graph_get_next_endpoint(mcpu_port, mcpu_ep_n);
 		if (!mcpu_ep_n) {
 			ret = 0;
 			break;
-- 
2.25.1


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

* [PATCH v3 19/24] ASoC: audio-graph-card2: use of_graph_get_next_endpoint()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index b2bd5b70a712..70f34e920423 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -555,7 +555,7 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link,
 		if (*nm_idx > nm_max)
 			break;
 
-		mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n);
+		mcpu_ep_n = of_graph_get_next_endpoint(mcpu_port, mcpu_ep_n);
 		if (!mcpu_ep_n) {
 			ret = 0;
 			break;
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 20/24] ASoC: test-component: use for_each_port_of_node()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Current test-component.c is using for_each_endpoint_of_node() for parsing,
but it should use "port" base loop instead of "endpoint", because
properties are "port" base instead of "endpoint".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/test-component.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index 0ebacbcddee3..a7bcd668e1f7 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	}
 
 	i = 0;
-	for_each_device_endpoint_of_node(node, ep) {
+	for_each_port_of_node(node, ep) {
 		snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i);
 		ddriv[i].name = dname[i].name;
 
-- 
2.25.1


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

* [PATCH v3 20/24] ASoC: test-component: use for_each_port_of_node()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

Current test-component.c is using for_each_endpoint_of_node() for parsing,
but it should use "port" base loop instead of "endpoint", because
properties are "port" base instead of "endpoint".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/test-component.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index 0ebacbcddee3..a7bcd668e1f7 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	}
 
 	i = 0;
-	for_each_device_endpoint_of_node(node, ep) {
+	for_each_port_of_node(node, ep) {
 		snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i);
 		ddriv[i].name = dname[i].name;
 
-- 
2.25.1


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

* [PATCH v3 20/24] ASoC: test-component: use for_each_port_of_node()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Current test-component.c is using for_each_endpoint_of_node() for parsing,
but it should use "port" base loop instead of "endpoint", because
properties are "port" base instead of "endpoint".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/test-component.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c
index 0ebacbcddee3..a7bcd668e1f7 100644
--- a/sound/soc/generic/test-component.c
+++ b/sound/soc/generic/test-component.c
@@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev)
 	}
 
 	i = 0;
-	for_each_device_endpoint_of_node(node, ep) {
+	for_each_port_of_node(node, ep) {
 		snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i);
 		ddriv[i].name = dname[i].name;
 
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 21/24] fbdev: omapfb: use of_graph_get_remote_port()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We already have of_graph_get_remote_port(), Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 0282d4eef139..fe6c72d03216 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -117,19 +117,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 	return reg;
 }
 
-static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
-{
-	struct device_node *np;
-
-	np = of_graph_get_remote_endpoint(node);
-	if (!np)
-		return NULL;
-
-	np = of_get_next_parent(np);
-
-	return np;
-}
-
 struct device_node *
 omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
@@ -159,7 +146,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
 	if (!ep)
 		return ERR_PTR(-EINVAL);
 
-	src_port = omapdss_of_get_remote_port(ep);
+	src_port = of_graph_get_remote_port(ep);
 	if (!src_port) {
 		of_node_put(ep);
 		return ERR_PTR(-EINVAL);
-- 
2.25.1


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

* [PATCH v3 21/24] fbdev: omapfb: use of_graph_get_remote_port()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We already have of_graph_get_remote_port(), Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 0282d4eef139..fe6c72d03216 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -117,19 +117,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 	return reg;
 }
 
-static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
-{
-	struct device_node *np;
-
-	np = of_graph_get_remote_endpoint(node);
-	if (!np)
-		return NULL;
-
-	np = of_get_next_parent(np);
-
-	return np;
-}
-
 struct device_node *
 omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
@@ -159,7 +146,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
 	if (!ep)
 		return ERR_PTR(-EINVAL);
 
-	src_port = omapdss_of_get_remote_port(ep);
+	src_port = of_graph_get_remote_port(ep);
 	if (!src_port) {
 		of_node_put(ep);
 		return ERR_PTR(-EINVAL);
-- 
2.25.1


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

* [PATCH v3 21/24] fbdev: omapfb: use of_graph_get_remote_port()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We already have of_graph_get_remote_port(), Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 0282d4eef139..fe6c72d03216 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -117,19 +117,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 	return reg;
 }
 
-static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
-{
-	struct device_node *np;
-
-	np = of_graph_get_remote_endpoint(node);
-	if (!np)
-		return NULL;
-
-	np = of_get_next_parent(np);
-
-	return np;
-}
-
 struct device_node *
 omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
@@ -159,7 +146,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
 	if (!ep)
 		return ERR_PTR(-EINVAL);
 
-	src_port = omapdss_of_get_remote_port(ep);
+	src_port = of_graph_get_remote_port(ep);
 	if (!src_port) {
 		of_node_put(ep);
 		return ERR_PTR(-EINVAL);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 22/24] fbdev: omapfb: use of_graph_get_next_port()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Now we can use of_graph_get_next_port() for port parsing.
Use it on omapfb.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 48 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |  9 ++--
 include/video/omapfb_dss.h                    |  4 --
 3 files changed, 6 insertions(+), 55 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index fe6c72d03216..321ae18f2747 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,52 +15,6 @@
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev)
-{
-	struct device_node *port = NULL;
-
-	if (!parent)
-		return NULL;
-
-	if (!prev) {
-		struct device_node *ports;
-		/*
-		 * It's the first call, we have to find a port subnode
-		 * within this node or within an optional 'ports' node.
-		 */
-		ports = of_get_child_by_name(parent, "ports");
-		if (ports)
-			parent = ports;
-
-		port = of_get_child_by_name(parent, "port");
-
-		/* release the 'ports' node */
-		of_node_put(ports);
-	} else {
-		struct device_node *ports;
-
-		ports = of_get_parent(prev);
-		if (!ports)
-			return NULL;
-
-		do {
-			port = of_get_next_child(ports, prev);
-			if (!port) {
-				of_node_put(ports);
-				return NULL;
-			}
-			prev = port;
-		} while (!of_node_name_eq(port, "port"));
-
-		of_node_put(ports);
-	}
-
-	return port;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_port);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev)
@@ -122,7 +76,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
 	struct device_node *port, *ep;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 
 	if (!port)
 		return NULL;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
index d814e4baa4b3..5cab317011ee 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
@@ -26,6 +26,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/suspend.h>
 #include <linux/component.h>
@@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return 0;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return 0;
 
@@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev)
 			break;
 		}
 	} while (!ret &&
-		 (port = omapdss_of_get_next_port(parent, port)) != NULL);
+		 (port = of_graph_get_next_port(parent, port)) != NULL);
 
 	if (ret)
 		dss_uninit_ports(pdev);
@@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return;
 
@@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev)
 		default:
 			break;
 		}
-	} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+	} while ((port = of_graph_get_next_port(parent, port)) != NULL);
 }
 
 static int dss_video_pll_probe(struct platform_device *pdev)
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index e8eaac2cb7b8..426d12881132 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev);
-- 
2.25.1


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

* [PATCH v3 22/24] fbdev: omapfb: use of_graph_get_next_port()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

Now we can use of_graph_get_next_port() for port parsing.
Use it on omapfb.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 48 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |  9 ++--
 include/video/omapfb_dss.h                    |  4 --
 3 files changed, 6 insertions(+), 55 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index fe6c72d03216..321ae18f2747 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,52 +15,6 @@
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev)
-{
-	struct device_node *port = NULL;
-
-	if (!parent)
-		return NULL;
-
-	if (!prev) {
-		struct device_node *ports;
-		/*
-		 * It's the first call, we have to find a port subnode
-		 * within this node or within an optional 'ports' node.
-		 */
-		ports = of_get_child_by_name(parent, "ports");
-		if (ports)
-			parent = ports;
-
-		port = of_get_child_by_name(parent, "port");
-
-		/* release the 'ports' node */
-		of_node_put(ports);
-	} else {
-		struct device_node *ports;
-
-		ports = of_get_parent(prev);
-		if (!ports)
-			return NULL;
-
-		do {
-			port = of_get_next_child(ports, prev);
-			if (!port) {
-				of_node_put(ports);
-				return NULL;
-			}
-			prev = port;
-		} while (!of_node_name_eq(port, "port"));
-
-		of_node_put(ports);
-	}
-
-	return port;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_port);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev)
@@ -122,7 +76,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
 	struct device_node *port, *ep;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 
 	if (!port)
 		return NULL;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
index d814e4baa4b3..5cab317011ee 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
@@ -26,6 +26,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/suspend.h>
 #include <linux/component.h>
@@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return 0;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return 0;
 
@@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev)
 			break;
 		}
 	} while (!ret &&
-		 (port = omapdss_of_get_next_port(parent, port)) != NULL);
+		 (port = of_graph_get_next_port(parent, port)) != NULL);
 
 	if (ret)
 		dss_uninit_ports(pdev);
@@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return;
 
@@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev)
 		default:
 			break;
 		}
-	} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+	} while ((port = of_graph_get_next_port(parent, port)) != NULL);
 }
 
 static int dss_video_pll_probe(struct platform_device *pdev)
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index e8eaac2cb7b8..426d12881132 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev);
-- 
2.25.1


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

* [PATCH v3 22/24] fbdev: omapfb: use of_graph_get_next_port()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Now we can use of_graph_get_next_port() for port parsing.
Use it on omapfb.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 48 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |  9 ++--
 include/video/omapfb_dss.h                    |  4 --
 3 files changed, 6 insertions(+), 55 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index fe6c72d03216..321ae18f2747 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,52 +15,6 @@
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev)
-{
-	struct device_node *port = NULL;
-
-	if (!parent)
-		return NULL;
-
-	if (!prev) {
-		struct device_node *ports;
-		/*
-		 * It's the first call, we have to find a port subnode
-		 * within this node or within an optional 'ports' node.
-		 */
-		ports = of_get_child_by_name(parent, "ports");
-		if (ports)
-			parent = ports;
-
-		port = of_get_child_by_name(parent, "port");
-
-		/* release the 'ports' node */
-		of_node_put(ports);
-	} else {
-		struct device_node *ports;
-
-		ports = of_get_parent(prev);
-		if (!ports)
-			return NULL;
-
-		do {
-			port = of_get_next_child(ports, prev);
-			if (!port) {
-				of_node_put(ports);
-				return NULL;
-			}
-			prev = port;
-		} while (!of_node_name_eq(port, "port"));
-
-		of_node_put(ports);
-	}
-
-	return port;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_port);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev)
@@ -122,7 +76,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
 	struct device_node *port, *ep;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 
 	if (!port)
 		return NULL;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
index d814e4baa4b3..5cab317011ee 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
@@ -26,6 +26,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/suspend.h>
 #include <linux/component.h>
@@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return 0;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return 0;
 
@@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev)
 			break;
 		}
 	} while (!ret &&
-		 (port = omapdss_of_get_next_port(parent, port)) != NULL);
+		 (port = of_graph_get_next_port(parent, port)) != NULL);
 
 	if (ret)
 		dss_uninit_ports(pdev);
@@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return;
 
@@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev)
 		default:
 			break;
 		}
-	} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+	} while ((port = of_graph_get_next_port(parent, port)) != NULL);
 }
 
 static int dss_video_pll_probe(struct platform_device *pdev)
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index e8eaac2cb7b8..426d12881132 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev);
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 23/24] fbdev: omapfb: use of_graph_get_next_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 22 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |  3 ++-
 include/video/omapfb_dss.h                    |  4 ----
 4 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
index 7c1b7d89389a..d018ee755cf4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
@@ -20,6 +20,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/clk.h>
 #include <linux/component.h>
 
@@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port)
 	if (!dpi)
 		return -ENOMEM;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 321ae18f2747..2ba2554055fc 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,26 +15,6 @@
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
-			     struct device_node *prev)
-{
-	struct device_node *ep = NULL;
-
-	if (!parent)
-		return NULL;
-
-	do {
-		ep = of_get_next_child(parent, prev);
-		if (!ep)
-			return NULL;
-		prev = ep;
-	} while (!of_node_name_eq(ep, "endpoint"));
-
-	return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint);
-
 struct device_node *dss_of_port_get_parent_device(struct device_node *port)
 {
 	struct device_node *np;
@@ -81,7 +61,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
 	if (!port)
 		return NULL;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 
 	of_node_put(port);
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
index d527931b2b16..e92d84c9474c 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/component.h>
 
 #include <video/omapfb_dss.h>
@@ -405,7 +406,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port)
 	u32 datapairs;
 	int r;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index 426d12881132..fc106aaa75bf 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
-			     struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_first_endpoint(const struct device_node *parent);
 
-- 
2.25.1


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

* [PATCH v3 23/24] fbdev: omapfb: use of_graph_get_next_endpoint()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 22 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |  3 ++-
 include/video/omapfb_dss.h                    |  4 ----
 4 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
index 7c1b7d89389a..d018ee755cf4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
@@ -20,6 +20,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/clk.h>
 #include <linux/component.h>
 
@@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port)
 	if (!dpi)
 		return -ENOMEM;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 321ae18f2747..2ba2554055fc 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,26 +15,6 @@
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
-			     struct device_node *prev)
-{
-	struct device_node *ep = NULL;
-
-	if (!parent)
-		return NULL;
-
-	do {
-		ep = of_get_next_child(parent, prev);
-		if (!ep)
-			return NULL;
-		prev = ep;
-	} while (!of_node_name_eq(ep, "endpoint"));
-
-	return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint);
-
 struct device_node *dss_of_port_get_parent_device(struct device_node *port)
 {
 	struct device_node *np;
@@ -81,7 +61,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
 	if (!port)
 		return NULL;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 
 	of_node_put(port);
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
index d527931b2b16..e92d84c9474c 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/component.h>
 
 #include <video/omapfb_dss.h>
@@ -405,7 +406,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port)
 	u32 datapairs;
 	int r;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index 426d12881132..fc106aaa75bf 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
-			     struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_first_endpoint(const struct device_node *parent);
 
-- 
2.25.1


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

* [PATCH v3 23/24] fbdev: omapfb: use of_graph_get_next_endpoint()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

We can now use of_graph_get_next_endpoint(), let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dpi.c    |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 22 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/sdi.c    |  3 ++-
 include/video/omapfb_dss.h                    |  4 ----
 4 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
index 7c1b7d89389a..d018ee755cf4 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
@@ -20,6 +20,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/clk.h>
 #include <linux/component.h>
 
@@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port)
 	if (!dpi)
 		return -ENOMEM;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 321ae18f2747..2ba2554055fc 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,26 +15,6 @@
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
-			     struct device_node *prev)
-{
-	struct device_node *ep = NULL;
-
-	if (!parent)
-		return NULL;
-
-	do {
-		ep = of_get_next_child(parent, prev);
-		if (!ep)
-			return NULL;
-		prev = ep;
-	} while (!of_node_name_eq(ep, "endpoint"));
-
-	return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint);
-
 struct device_node *dss_of_port_get_parent_device(struct device_node *port)
 {
 	struct device_node *np;
@@ -81,7 +61,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
 	if (!port)
 		return NULL;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 
 	of_node_put(port);
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
index d527931b2b16..e92d84c9474c 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/component.h>
 
 #include <video/omapfb_dss.h>
@@ -405,7 +406,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port)
 	u32 datapairs;
 	int r;
 
-	ep = omapdss_of_get_next_endpoint(port, NULL);
+	ep = of_graph_get_next_endpoint(port, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index 426d12881132..fc106aaa75bf 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
-			     struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_first_endpoint(const struct device_node *parent);
 
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v3 24/24] fbdev: omapfb: use of_graph_get_next_device_endpoint()
  2024-01-31  5:04 ` Kuninori Morimoto
  (?)
@ 2024-01-31  5:07   ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

omapdss_of_get_first_endpoint() is same as
of_graph_get_next_device_endpoint(xxx, NULL). Replcase it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c    |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c  |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c  |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/venc.c   |  3 ++-
 include/video/omapfb_dss.h                    |  3 ---
 6 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index b7eb17a16ec4..4d503aa824d3 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -28,6 +28,7 @@
 #include <linux/debugfs.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/of_platform.h>
 #include <linux/component.h>
 
@@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	struct omap_dsi_pin_config pin_cfg;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 2ba2554055fc..130bbe4813be 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -51,24 +51,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 	return reg;
 }
 
-struct device_node *
-omapdss_of_get_first_endpoint(const struct device_node *parent)
-{
-	struct device_node *port, *ep;
-
-	port = of_graph_get_next_port(parent, NULL);
-
-	if (!port)
-		return NULL;
-
-	ep = of_graph_get_next_endpoint(port, NULL);
-
-	of_node_put(port);
-
-	return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
-
 struct omap_dss_device *
 omapdss_of_find_source_for_first_ep(struct device_node *node)
 {
@@ -76,7 +58,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
 	struct device_node *src_port;
 	struct omap_dss_device *src;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return ERR_PTR(-EINVAL);
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
index f05b4e35a842..3a7d612c8feb 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
@@ -20,6 +20,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/component.h>
 #include <video/omapfb_dss.h>
@@ -529,7 +530,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
index 03292945b1d4..db01ac3ea387 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
@@ -25,6 +25,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/component.h>
 #include <video/omapfb_dss.h>
@@ -561,7 +562,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
index c9d40e28a06f..4dcc3f2a2aec 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
@@ -24,6 +24,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/component.h>
 
 #include <video/omapfb_dss.h>
@@ -764,7 +765,7 @@ static int venc_probe_of(struct platform_device *pdev)
 	u32 channels;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index fc106aaa75bf..d133190e3143 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,9 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_first_endpoint(const struct device_node *parent);
-
 struct omap_dss_device *
 omapdss_of_find_source_for_first_ep(struct device_node *node);
 #else
-- 
2.25.1


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

* [PATCH v3 24/24] fbdev: omapfb: use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: linux-fbdev, Tom Rix, llvm, dri-devel, linux-tegra,
	Laurent Pinchart, Alim Akhtar, Marijn Suijten, Sam Ravnborg,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Fabio Estevam,
	linux-staging, Jernej Skrabec, Jessica Zhang, Mike Leach,
	devicetree, Jonas Karlman, Martin Blumenstingl, linux-arm-msm,
	coresight, linux-sound, linux-rpi-kernel, Jacopo Mondi,
	linux-amlogic, linux-omap, Sean Paul, linux-arm-kernel,
	linux-renesas-soc, Leo Yan, linux-media, freedreno

omapdss_of_get_first_endpoint() is same as
of_graph_get_next_device_endpoint(xxx, NULL). Replcase it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c    |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c  |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c  |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/venc.c   |  3 ++-
 include/video/omapfb_dss.h                    |  3 ---
 6 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index b7eb17a16ec4..4d503aa824d3 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -28,6 +28,7 @@
 #include <linux/debugfs.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/of_platform.h>
 #include <linux/component.h>
 
@@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	struct omap_dsi_pin_config pin_cfg;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 2ba2554055fc..130bbe4813be 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -51,24 +51,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 	return reg;
 }
 
-struct device_node *
-omapdss_of_get_first_endpoint(const struct device_node *parent)
-{
-	struct device_node *port, *ep;
-
-	port = of_graph_get_next_port(parent, NULL);
-
-	if (!port)
-		return NULL;
-
-	ep = of_graph_get_next_endpoint(port, NULL);
-
-	of_node_put(port);
-
-	return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
-
 struct omap_dss_device *
 omapdss_of_find_source_for_first_ep(struct device_node *node)
 {
@@ -76,7 +58,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
 	struct device_node *src_port;
 	struct omap_dss_device *src;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return ERR_PTR(-EINVAL);
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
index f05b4e35a842..3a7d612c8feb 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
@@ -20,6 +20,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/component.h>
 #include <video/omapfb_dss.h>
@@ -529,7 +530,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
index 03292945b1d4..db01ac3ea387 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
@@ -25,6 +25,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/component.h>
 #include <video/omapfb_dss.h>
@@ -561,7 +562,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
index c9d40e28a06f..4dcc3f2a2aec 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
@@ -24,6 +24,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/component.h>
 
 #include <video/omapfb_dss.h>
@@ -764,7 +765,7 @@ static int venc_probe_of(struct platform_device *pdev)
 	u32 channels;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index fc106aaa75bf..d133190e3143 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,9 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_first_endpoint(const struct device_node *parent);
-
 struct omap_dss_device *
 omapdss_of_find_source_for_first_ep(struct device_node *node);
 #else
-- 
2.25.1


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

* [PATCH v3 24/24] fbdev: omapfb: use of_graph_get_next_device_endpoint()
@ 2024-01-31  5:07   ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31  5:07 UTC (permalink / raw)
  To: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Laurent Pinchart,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

omapdss_of_get_first_endpoint() is same as
of_graph_get_next_device_endpoint(xxx, NULL). Replcase it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c    |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c  |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c  |  3 ++-
 drivers/video/fbdev/omap2/omapfb/dss/venc.c   |  3 ++-
 include/video/omapfb_dss.h                    |  3 ---
 6 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index b7eb17a16ec4..4d503aa824d3 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -28,6 +28,7 @@
 #include <linux/debugfs.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/of_platform.h>
 #include <linux/component.h>
 
@@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	struct omap_dsi_pin_config pin_cfg;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index 2ba2554055fc..130bbe4813be 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -51,24 +51,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 	return reg;
 }
 
-struct device_node *
-omapdss_of_get_first_endpoint(const struct device_node *parent)
-{
-	struct device_node *port, *ep;
-
-	port = of_graph_get_next_port(parent, NULL);
-
-	if (!port)
-		return NULL;
-
-	ep = of_graph_get_next_endpoint(port, NULL);
-
-	of_node_put(port);
-
-	return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
-
 struct omap_dss_device *
 omapdss_of_find_source_for_first_ep(struct device_node *node)
 {
@@ -76,7 +58,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
 	struct device_node *src_port;
 	struct omap_dss_device *src;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return ERR_PTR(-EINVAL);
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
index f05b4e35a842..3a7d612c8feb 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
@@ -20,6 +20,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/component.h>
 #include <video/omapfb_dss.h>
@@ -529,7 +530,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
index 03292945b1d4..db01ac3ea387 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
@@ -25,6 +25,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/clk.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/regulator/consumer.h>
 #include <linux/component.h>
 #include <video/omapfb_dss.h>
@@ -561,7 +562,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
 	struct device_node *ep;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
index c9d40e28a06f..4dcc3f2a2aec 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
@@ -24,6 +24,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_graph.h>
 #include <linux/component.h>
 
 #include <video/omapfb_dss.h>
@@ -764,7 +765,7 @@ static int venc_probe_of(struct platform_device *pdev)
 	u32 channels;
 	int r;
 
-	ep = omapdss_of_get_first_endpoint(node);
+	ep = of_graph_get_next_device_endpoint(node, NULL);
 	if (!ep)
 		return 0;
 
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index fc106aaa75bf..d133190e3143 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,9 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_first_endpoint(const struct device_node *parent);
-
 struct omap_dss_device *
 omapdss_of_find_source_for_first_ep(struct device_node *node);
 #else
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
  2024-01-31  5:05   ` Kuninori Morimoto
  (?)
@ 2024-01-31  6:30     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 103+ messages in thread
From: Dmitry Baryshkov @ 2024-01-31  6:30 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad, Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Torokhov, Emma Anholt, Eugen Hristev, Florian Fainelli,
	Frank Rowand, Greg Kroah-Hartman, Hans Verkuil, Helge Deller,
	Hugues Fruchet, Jacopo Mondi, Jacopo Mondi, James Clark,
	Jaroslav Kysela, Jonathan Hunter, Kevin Hilman, Kieran Bingham,
	Kieran Bingham, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Laurent Pinchart, Liam Girdwood, Liu Ying,
	Luca Ceresoli, Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Suzuki K Poulose, Sylwester Nawrocki, Takashi Iwai,
	Thierry Reding, Thomas Zimmermann, Tim Harvey, Todor Tomov,
	Tomi Valkeinen, Yannick Fertre, Alim Akhtar, Fabio Estevam,
	Jacopo Mondi, Jernej Skrabec, Jerome Brunet, Jessica Zhang,
	Jonas Karlman, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm

On Wed, 31 Jan 2024 at 07:05, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> The return type and the variable of of_graph_get_endpoint_count()
> should be unsigned. Tidyup it.

'the variable'?

I'd have added a few words telling that return type can be unsigned
because there is no error reporting for this function.

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/of/property.c    | 2 +-
>  include/linux/of_graph.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 4e879faa1710..25d73409aeee 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -817,7 +817,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port);
>   *
>   * Return: count of endpoint of this device node
>   */
> -int of_graph_get_endpoint_count(const struct device_node *np)
> +unsigned int of_graph_get_endpoint_count(const struct device_node *np)
>  {
>         struct device_node *endpoint;
>         int num = 0;
> diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
> index 4d7756087b6b..a4bea62bfa29 100644
> --- a/include/linux/of_graph.h
> +++ b/include/linux/of_graph.h
> @@ -41,7 +41,7 @@ struct of_endpoint {
>  bool of_graph_is_present(const struct device_node *node);
>  int of_graph_parse_endpoint(const struct device_node *node,
>                                 struct of_endpoint *endpoint);
> -int of_graph_get_endpoint_count(const struct device_node *np);
> +unsigned int of_graph_get_endpoint_count(const struct device_node *np);
>  struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
>  struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
>                                         struct device_node *previous);
> @@ -68,7 +68,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
>         return -ENOSYS;
>  }
>
> -static inline int of_graph_get_endpoint_count(const struct device_node *np)
> +static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
>  {
>         return 0;
>  }
> --
> 2.25.1
>


--
With best wishes
Dmitry

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

* Re: [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
@ 2024-01-31  6:30     ` Dmitry Baryshkov
  0 siblings, 0 replies; 103+ messages in thread
From: Dmitry Baryshkov @ 2024-01-31  6:30 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: dri-devel, Jaroslav Kysela, Sylwester Nawrocki, Marijn Suijten,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Robert Foss,
	Dave Stevenson, Kevin Hilman, Alexander Stein,
	Uwe Kleine-König, Luca Ceresoli, Raphael Gallais-Pou,
	Sascha Hauer, Eugen Hristev, Sam Ravnborg, linux-omap, Sean Paul,
	Greg Kroah-Hartman, Nick Desaulniers, Michael Tretter,
	Sowjanya Komatineni, Hans Verkuil, freedreno, Alexandre Belloni,
	Alim Akhtar, Tomi Valkeinen, Claudiu Beznea, Lad, Prabhakar,
	Thierry Reding, James Clark, Saravana Kannan, Fabio Estevam,
	Helge Deller, Alexey Brodkin, Jonathan Hunter,
	Martin Blumenstingl, Miguel Ojeda, Jessica Zhang, linux-media,
	Jacopo Mondi, Suzuki K Poulose, Liu Ying, linux-arm-msm,
	coresight, Maxime Ripard, linux-rpi-kernel, Biju Das,
	linux-amlogic, Michal Simek, linux-arm-kernel, Neil Armstrong,
	Niklas Söderlund, linux-renesas-soc, Jacopo Mondi,
	Maxime Coquelin, Alexander Shishkin, Tom Rix, linux-fbdev,
	linux-tegra, Laurent Pinchart, Andrzej Hajda, Frank Rowand,
	linux-staging, Kieran Bingham, Jernej Skrabec,
	Bryan O'Donoghue, Jonas Karlman, Tim Harvey, Abhinav Kumar,
	Nathan Chancellor, Mark Brown, Daniel Vetter,
	Mauro Carvalho Chehab, Dmitry Torokhov, Liam Girdwood,
	Konrad Dybcio, Kieran Bingham, Sakari Ailus, Shawn Guo,
	Yannick Fertre, Emma Anholt, llvm, Alexandre Torgue, Todor Tomov,
	Takashi Iwai, Krzysztof Kozlowski, Marek Vasut, Laurent Pinchart,
	Florian Fainelli, Hugues Fruchet, Russell King, Andy Gross,
	Mike Leach, devicetree, Thomas Zimmermann, Rob Herring,
	linux-sound, Jacopo Mondi, Bjorn Andersson, Nicolas Ferre,
	Philippe Cornu, Leo Yan

On Wed, 31 Jan 2024 at 07:05, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> The return type and the variable of of_graph_get_endpoint_count()
> should be unsigned. Tidyup it.

'the variable'?

I'd have added a few words telling that return type can be unsigned
because there is no error reporting for this function.

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/of/property.c    | 2 +-
>  include/linux/of_graph.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 4e879faa1710..25d73409aeee 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -817,7 +817,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port);
>   *
>   * Return: count of endpoint of this device node
>   */
> -int of_graph_get_endpoint_count(const struct device_node *np)
> +unsigned int of_graph_get_endpoint_count(const struct device_node *np)
>  {
>         struct device_node *endpoint;
>         int num = 0;
> diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
> index 4d7756087b6b..a4bea62bfa29 100644
> --- a/include/linux/of_graph.h
> +++ b/include/linux/of_graph.h
> @@ -41,7 +41,7 @@ struct of_endpoint {
>  bool of_graph_is_present(const struct device_node *node);
>  int of_graph_parse_endpoint(const struct device_node *node,
>                                 struct of_endpoint *endpoint);
> -int of_graph_get_endpoint_count(const struct device_node *np);
> +unsigned int of_graph_get_endpoint_count(const struct device_node *np);
>  struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
>  struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
>                                         struct device_node *previous);
> @@ -68,7 +68,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
>         return -ENOSYS;
>  }
>
> -static inline int of_graph_get_endpoint_count(const struct device_node *np)
> +static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
>  {
>         return 0;
>  }
> --
> 2.25.1
>


--
With best wishes
Dmitry

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

* Re: [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
@ 2024-01-31  6:30     ` Dmitry Baryshkov
  0 siblings, 0 replies; 103+ messages in thread
From: Dmitry Baryshkov @ 2024-01-31  6:30 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad, Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Torokhov, Emma Anholt, Eugen Hristev, Florian Fainelli,
	Frank Rowand, Greg Kroah-Hartman, Hans Verkuil, Helge Deller,
	Hugues Fruchet, Jacopo Mondi, Jacopo Mondi, James Clark,
	Jaroslav Kysela, Jonathan Hunter, Kevin Hilman, Kieran Bingham,
	Kieran Bingham, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Laurent Pinchart, Liam Girdwood, Liu Ying,
	Luca Ceresoli, Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Suzuki K Poulose, Sylwester Nawrocki, Takashi Iwai,
	Thierry Reding, Thomas Zimmermann, Tim Harvey, Todor Tomov,
	Tomi Valkeinen, Yannick Fertre, Alim Akhtar, Fabio Estevam,
	Jacopo Mondi, Jernej Skrabec, Jerome Brunet, Jessica Zhang,
	Jonas Karlman, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm

On Wed, 31 Jan 2024 at 07:05, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> The return type and the variable of of_graph_get_endpoint_count()
> should be unsigned. Tidyup it.

'the variable'?

I'd have added a few words telling that return type can be unsigned
because there is no error reporting for this function.

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/of/property.c    | 2 +-
>  include/linux/of_graph.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index 4e879faa1710..25d73409aeee 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -817,7 +817,7 @@ EXPORT_SYMBOL(of_graph_get_remote_port);
>   *
>   * Return: count of endpoint of this device node
>   */
> -int of_graph_get_endpoint_count(const struct device_node *np)
> +unsigned int of_graph_get_endpoint_count(const struct device_node *np)
>  {
>         struct device_node *endpoint;
>         int num = 0;
> diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
> index 4d7756087b6b..a4bea62bfa29 100644
> --- a/include/linux/of_graph.h
> +++ b/include/linux/of_graph.h
> @@ -41,7 +41,7 @@ struct of_endpoint {
>  bool of_graph_is_present(const struct device_node *node);
>  int of_graph_parse_endpoint(const struct device_node *node,
>                                 struct of_endpoint *endpoint);
> -int of_graph_get_endpoint_count(const struct device_node *np);
> +unsigned int of_graph_get_endpoint_count(const struct device_node *np);
>  struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
>  struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
>                                         struct device_node *previous);
> @@ -68,7 +68,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node,
>         return -ENOSYS;
>  }
>
> -static inline int of_graph_get_endpoint_count(const struct device_node *np)
> +static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np)
>  {
>         return 0;
>  }
> --
> 2.25.1
>


--
With best wishes
Dmitry

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 07/24] gpu: drm: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:05   ` Kuninori Morimoto
  (?)
@ 2024-01-31  6:32     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 103+ messages in thread
From: Dmitry Baryshkov @ 2024-01-31  6:32 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad, Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Torokhov, Emma Anholt, Eugen Hristev, Florian Fainelli,
	Frank Rowand, Greg Kroah-Hartman, Hans Verkuil, Helge Deller,
	Hugues Fruchet, Jacopo Mondi, Jacopo Mondi, James Clark,
	Jaroslav Kysela, Jonathan Hunter, Kevin Hilman, Kieran Bingham,
	Kieran Bingham, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Laurent Pinchart, Liam Girdwood, Liu Ying,
	Luca Ceresoli, Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Suzuki K Poulose, Sylwester Nawrocki, Takashi Iwai,
	Thierry Reding, Thomas Zimmermann, Tim Harvey, Todor Tomov,
	Tomi Valkeinen, Yannick Fertre, Alim Akhtar, Fabio Estevam,
	Jacopo Mondi, Jernej Skrabec, Jerome Brunet, Jessica Zhang,
	Jonas Karlman, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm

On Wed, 31 Jan 2024 at 07:05, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/gpu/drm/armada/armada_drv.c                   | 2 +-
>  drivers/gpu/drm/bridge/tc358767.c                     | 2 +-
>  drivers/gpu/drm/drm_of.c                              | 6 +++---
>  drivers/gpu/drm/meson/meson_drv.c                     | 4 ++--
>  drivers/gpu/drm/msm/msm_drv.c                         | 2 +-
>  drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 2 +-
>  drivers/gpu/drm/omapdrm/dss/base.c                    | 2 +-
>  drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
>  drivers/gpu/drm/pl111/pl111_drv.c                     | 2 +-
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 +-
>  drivers/gpu/drm/stm/ltdc.c                            | 4 ++--
>  drivers/gpu/drm/tiny/arcpgu.c                         | 2 +-
>  12 files changed, 16 insertions(+), 16 deletions(-)
>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry

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

* Re: [PATCH v3 07/24] gpu: drm: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  6:32     ` Dmitry Baryshkov
  0 siblings, 0 replies; 103+ messages in thread
From: Dmitry Baryshkov @ 2024-01-31  6:32 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: dri-devel, Jaroslav Kysela, Sylwester Nawrocki, Marijn Suijten,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Robert Foss,
	Dave Stevenson, Kevin Hilman, Alexander Stein,
	Uwe Kleine-König, Luca Ceresoli, Raphael Gallais-Pou,
	Sascha Hauer, Eugen Hristev, Sam Ravnborg, linux-omap, Sean Paul,
	Greg Kroah-Hartman, Nick Desaulniers, Michael Tretter,
	Sowjanya Komatineni, Hans Verkuil, freedreno, Alexandre Belloni,
	Alim Akhtar, Tomi Valkeinen, Claudiu Beznea, Lad, Prabhakar,
	Thierry Reding, James Clark, Saravana Kannan, Fabio Estevam,
	Helge Deller, Alexey Brodkin, Jonathan Hunter,
	Martin Blumenstingl, Miguel Ojeda, Jessica Zhang, linux-media,
	Jacopo Mondi, Suzuki K Poulose, Liu Ying, linux-arm-msm,
	coresight, Maxime Ripard, linux-rpi-kernel, Biju Das,
	linux-amlogic, Michal Simek, linux-arm-kernel, Neil Armstrong,
	Niklas Söderlund, linux-renesas-soc, Jacopo Mondi,
	Maxime Coquelin, Alexander Shishkin, Tom Rix, linux-fbdev,
	linux-tegra, Laurent Pinchart, Andrzej Hajda, Frank Rowand,
	linux-staging, Kieran Bingham, Jernej Skrabec,
	Bryan O'Donoghue, Jonas Karlman, Tim Harvey, Abhinav Kumar,
	Nathan Chancellor, Mark Brown, Daniel Vetter,
	Mauro Carvalho Chehab, Dmitry Torokhov, Liam Girdwood,
	Konrad Dybcio, Kieran Bingham, Sakari Ailus, Shawn Guo,
	Yannick Fertre, Emma Anholt, llvm, Alexandre Torgue, Todor Tomov,
	Takashi Iwai, Krzysztof Kozlowski, Marek Vasut, Laurent Pinchart,
	Florian Fainelli, Hugues Fruchet, Russell King, Andy Gross,
	Mike Leach, devicetree, Thomas Zimmermann, Rob Herring,
	linux-sound, Jacopo Mondi, Bjorn Andersson, Nicolas Ferre,
	Philippe Cornu, Leo Yan

On Wed, 31 Jan 2024 at 07:05, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/gpu/drm/armada/armada_drv.c                   | 2 +-
>  drivers/gpu/drm/bridge/tc358767.c                     | 2 +-
>  drivers/gpu/drm/drm_of.c                              | 6 +++---
>  drivers/gpu/drm/meson/meson_drv.c                     | 4 ++--
>  drivers/gpu/drm/msm/msm_drv.c                         | 2 +-
>  drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 2 +-
>  drivers/gpu/drm/omapdrm/dss/base.c                    | 2 +-
>  drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
>  drivers/gpu/drm/pl111/pl111_drv.c                     | 2 +-
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 +-
>  drivers/gpu/drm/stm/ltdc.c                            | 4 ++--
>  drivers/gpu/drm/tiny/arcpgu.c                         | 2 +-
>  12 files changed, 16 insertions(+), 16 deletions(-)
>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry

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

* Re: [PATCH v3 07/24] gpu: drm: switch to use of_graph_get_next_device_endpoint()
@ 2024-01-31  6:32     ` Dmitry Baryshkov
  0 siblings, 0 replies; 103+ messages in thread
From: Dmitry Baryshkov @ 2024-01-31  6:32 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad, Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Torokhov, Emma Anholt, Eugen Hristev, Florian Fainelli,
	Frank Rowand, Greg Kroah-Hartman, Hans Verkuil, Helge Deller,
	Hugues Fruchet, Jacopo Mondi, Jacopo Mondi, James Clark,
	Jaroslav Kysela, Jonathan Hunter, Kevin Hilman, Kieran Bingham,
	Kieran Bingham, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Laurent Pinchart, Liam Girdwood, Liu Ying,
	Luca Ceresoli, Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Suzuki K Poulose, Sylwester Nawrocki, Takashi Iwai,
	Thierry Reding, Thomas Zimmermann, Tim Harvey, Todor Tomov,
	Tomi Valkeinen, Yannick Fertre, Alim Akhtar, Fabio Estevam,
	Jacopo Mondi, Jernej Skrabec, Jerome Brunet, Jessica Zhang,
	Jonas Karlman, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm

On Wed, 31 Jan 2024 at 07:05, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/gpu/drm/armada/armada_drv.c                   | 2 +-
>  drivers/gpu/drm/bridge/tc358767.c                     | 2 +-
>  drivers/gpu/drm/drm_of.c                              | 6 +++---
>  drivers/gpu/drm/meson/meson_drv.c                     | 4 ++--
>  drivers/gpu/drm/msm/msm_drv.c                         | 2 +-
>  drivers/gpu/drm/mxsfb/lcdif_drv.c                     | 2 +-
>  drivers/gpu/drm/omapdrm/dss/base.c                    | 2 +-
>  drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +-
>  drivers/gpu/drm/pl111/pl111_drv.c                     | 2 +-
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c         | 2 +-
>  drivers/gpu/drm/stm/ltdc.c                            | 4 ++--
>  drivers/gpu/drm/tiny/arcpgu.c                         | 2 +-
>  12 files changed, 16 insertions(+), 16 deletions(-)
>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
  2024-01-31  5:06   ` Kuninori Morimoto
  (?)
@ 2024-01-31  9:07     ` Luca Ceresoli
  -1 siblings, 0 replies; 103+ messages in thread
From: Luca Ceresoli @ 2024-01-31  9:07 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Maarten Lankhorst, Marek Vasut,
	Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Hello Kuninori Morimoto,

On Wed, 31 Jan 2024 05:06:36 +0000
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> To handle endpoint more intuitive, create of_graph_get_next_endpoint()
> 
> 	of_graph_get_next_endpoint(port1, NULL); // A1
> 	of_graph_get_next_endpoint(port1, A1);   // A2
> 	of_graph_get_next_endpoint(port1, A2);   // NULL

The idea looks good. My only concern is about reusing the
of_graph_get_next_endpoint() name after having removed the old, different
function having the same name. This can be confusing in the first
place to who is used to the old function, and also to anybody rebasing
their patches on top of a new kernel to find their code behaving
differently.

Also, as now we'd have two similar variants of this function, it would
be good if each of them were having a name that clearly identifies in
which way they differ from the other.

So a better name for this function would probably be
of_graph_get_next_port_endpoint() I guess, to clearly differentiate from
of_graph_get_next_device_endpoint().

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
@ 2024-01-31  9:07     ` Luca Ceresoli
  0 siblings, 0 replies; 103+ messages in thread
From: Luca Ceresoli @ 2024-01-31  9:07 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: dri-devel, Jaroslav Kysela, Sylwester Nawrocki, Marijn Suijten,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Robert Foss,
	Dave Stevenson, Kevin Hilman, Alexander Stein,
	Uwe Kleine-König, Raphael Gallais-Pou, Sascha Hauer,
	Eugen Hristev, Sam Ravnborg, linux-omap, Sean Paul,
	Greg Kroah-Hartman, Nick Desaulniers, Michael Tretter,
	Sowjanya Komatineni, Hans Verkuil, freedreno, Alexandre Belloni,
	Alim Akhtar, Tomi Valkeinen, Claudiu Beznea, Lad, Prabhakar,
	Thierry Reding, James Clark, Saravana Kannan, Fabio Estevam,
	Helge Deller, Alexey Brodkin, Jonathan Hunter,
	Martin Blumenstingl, Miguel Ojeda, Jessica Zhang, linux-media,
	Jacopo Mondi, Suzuki K Poulose, Liu Ying, linux-arm-msm,
	coresight, Maxime Ripard, linux-rpi-kernel, Biju Das,
	linux-amlogic, Michal Simek, linux-arm-kernel, Neil Armstrong,
	Niklas Söderlund, linux-renesas-soc, Jacopo Mondi,
	Maxime Coquelin, Alexander Shishkin, Tom Rix, linux-fbdev,
	linux-tegra, Laurent Pinchart, Andrzej Hajda, Frank Rowand,
	linux-staging, Kieran Bingham, Jernej Skrabec,
	Bryan O'Donoghue, Jonas Karlman, Tim Harvey, Abhinav Kumar,
	Nathan Chancellor, Mark Brown, Daniel Vetter,
	Mauro Carvalho Chehab, Dmitry Torokhov, Liam Girdwood,
	Konrad Dybcio, Kieran Bingham, Sakari Ailus, Shawn Guo,
	Yannick Fertre, Emma Anholt, llvm, Alexandre Torgue, Todor Tomov,
	Takashi Iwai, Krzysztof Kozlowski, Marek Vasut, Laurent Pinchart,
	Florian Fainelli, Hugues Fruchet, Russell King, Andy Gross,
	Mike Leach, devicetree, Thomas Zimmermann, Rob Herring,
	linux-sound, Jacopo Mondi, Bjorn Andersson, Nicolas Ferre,
	Philippe Cornu, Leo Yan, Dmitry Baryshkov

Hello Kuninori Morimoto,

On Wed, 31 Jan 2024 05:06:36 +0000
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> To handle endpoint more intuitive, create of_graph_get_next_endpoint()
> 
> 	of_graph_get_next_endpoint(port1, NULL); // A1
> 	of_graph_get_next_endpoint(port1, A1);   // A2
> 	of_graph_get_next_endpoint(port1, A2);   // NULL

The idea looks good. My only concern is about reusing the
of_graph_get_next_endpoint() name after having removed the old, different
function having the same name. This can be confusing in the first
place to who is used to the old function, and also to anybody rebasing
their patches on top of a new kernel to find their code behaving
differently.

Also, as now we'd have two similar variants of this function, it would
be good if each of them were having a name that clearly identifies in
which way they differ from the other.

So a better name for this function would probably be
of_graph_get_next_port_endpoint() I guess, to clearly differentiate from
of_graph_get_next_device_endpoint().

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
@ 2024-01-31  9:07     ` Luca Ceresoli
  0 siblings, 0 replies; 103+ messages in thread
From: Luca Ceresoli @ 2024-01-31  9:07 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Maarten Lankhorst, Marek Vasut,
	Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Hello Kuninori Morimoto,

On Wed, 31 Jan 2024 05:06:36 +0000
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> wrote:

> To handle endpoint more intuitive, create of_graph_get_next_endpoint()
> 
> 	of_graph_get_next_endpoint(port1, NULL); // A1
> 	of_graph_get_next_endpoint(port1, A1);   // A2
> 	of_graph_get_next_endpoint(port1, A2);   // NULL

The idea looks good. My only concern is about reusing the
of_graph_get_next_endpoint() name after having removed the old, different
function having the same name. This can be confusing in the first
place to who is used to the old function, and also to anybody rebasing
their patches on top of a new kernel to find their code behaving
differently.

Also, as now we'd have two similar variants of this function, it would
be good if each of them were having a name that clearly identifies in
which way they differ from the other.

So a better name for this function would probably be
of_graph_get_next_port_endpoint() I guess, to clearly differentiate from
of_graph_get_next_device_endpoint().

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
  2024-01-31  9:07     ` Luca Ceresoli
  (?)
@ 2024-01-31 23:26       ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31 23:26 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Maarten Lankhorst, Marek Vasut,
	Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm


Hi Luca

Thank you for your review

> > To handle endpoint more intuitive, create of_graph_get_next_endpoint()
> > 
> > 	of_graph_get_next_endpoint(port1, NULL); // A1
> > 	of_graph_get_next_endpoint(port1, A1);   // A2
> > 	of_graph_get_next_endpoint(port1, A2);   // NULL
> 
> The idea looks good. My only concern is about reusing the
> of_graph_get_next_endpoint() name after having removed the old, different
> function having the same name. This can be confusing in the first
> place to who is used to the old function, and also to anybody rebasing
> their patches on top of a new kernel to find their code behaving
> differently.
> 
> Also, as now we'd have two similar variants of this function, it would
> be good if each of them were having a name that clearly identifies in
> which way they differ from the other.
> 
> So a better name for this function would probably be
> of_graph_get_next_port_endpoint() I guess, to clearly differentiate from
> of_graph_get_next_device_endpoint().

Yes, Indeed, Thank you for pointing it !
I will update it on v4


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
@ 2024-01-31 23:26       ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31 23:26 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: dri-devel, Jaroslav Kysela, Sylwester Nawrocki, Marijn Suijten,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Robert Foss,
	Dave Stevenson, Kevin Hilman, Alexander Stein,
	Uwe Kleine-König, Raphael Gallais-Pou, Sascha Hauer,
	Eugen Hristev, Sam Ravnborg, linux-omap, Sean Paul,
	Greg Kroah-Hartman, Nick Desaulniers, Michael Tretter,
	Sowjanya Komatineni, Hans Verkuil, freedreno, Alexandre Belloni,
	Alim Akhtar, Tomi Valkeinen, Claudiu Beznea, Lad, Prabhakar,
	Thierry Reding, James Clark, Saravana Kannan, Fabio Estevam,
	Helge Deller, Alexey Brodkin, Jonathan Hunter,
	Martin Blumenstingl, Miguel Ojeda, Jessica Zhang, linux-media,
	Jacopo Mondi, Suzuki K Poulose, Liu Ying, linux-arm-msm,
	coresight, Maxime Ripard, linux-rpi-kernel, Biju Das,
	linux-amlogic, Michal Simek, linux-arm-kernel, Neil Armstrong,
	Niklas Söderlund, linux-renesas-soc, Jacopo Mondi,
	Maxime Coquelin, Alexander Shishkin, Tom Rix, linux-fbdev,
	linux-tegra, Laurent Pinchart, Andrzej Hajda, Frank Rowand,
	linux-staging, Kieran Bingham, Jernej Skrabec,
	Bryan O'Donoghue, Jonas Karlman, Tim Harvey, Abhinav Kumar,
	Nathan Chancellor, Mark Brown, Daniel Vetter,
	Mauro Carvalho Chehab, Dmitry Torokhov, Liam Girdwood,
	Konrad Dybcio, Kieran Bingham, Sakari Ailus, Shawn Guo,
	Yannick Fertre, Emma Anholt, llvm, Alexandre Torgue, Todor Tomov,
	Takashi Iwai, Krzysztof Kozlowski, Marek Vasut, Laurent Pinchart,
	Florian Fainelli, Hugues Fruchet, Russell King, Andy Gross,
	Mike Leach, devicetree, Thomas Zimmermann, Rob Herring,
	linux-sound, Jacopo Mondi, Bjorn Andersson, Nicolas Ferre,
	Philippe Cornu, Leo Yan, Dmitry Baryshkov


Hi Luca

Thank you for your review

> > To handle endpoint more intuitive, create of_graph_get_next_endpoint()
> > 
> > 	of_graph_get_next_endpoint(port1, NULL); // A1
> > 	of_graph_get_next_endpoint(port1, A1);   // A2
> > 	of_graph_get_next_endpoint(port1, A2);   // NULL
> 
> The idea looks good. My only concern is about reusing the
> of_graph_get_next_endpoint() name after having removed the old, different
> function having the same name. This can be confusing in the first
> place to who is used to the old function, and also to anybody rebasing
> their patches on top of a new kernel to find their code behaving
> differently.
> 
> Also, as now we'd have two similar variants of this function, it would
> be good if each of them were having a name that clearly identifies in
> which way they differ from the other.
> 
> So a better name for this function would probably be
> of_graph_get_next_port_endpoint() I guess, to clearly differentiate from
> of_graph_get_next_device_endpoint().

Yes, Indeed, Thank you for pointing it !
I will update it on v4


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint()
@ 2024-01-31 23:26       ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-01-31 23:26 UTC (permalink / raw)
  To: Luca Ceresoli
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Maarten Lankhorst, Marek Vasut,
	Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Rob Herring, Robert Foss,
	Russell King, Sakari Ailus, Saravana Kannan, Sascha Hauer,
	Shawn Guo, Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm


Hi Luca

Thank you for your review

> > To handle endpoint more intuitive, create of_graph_get_next_endpoint()
> > 
> > 	of_graph_get_next_endpoint(port1, NULL); // A1
> > 	of_graph_get_next_endpoint(port1, A1);   // A2
> > 	of_graph_get_next_endpoint(port1, A2);   // NULL
> 
> The idea looks good. My only concern is about reusing the
> of_graph_get_next_endpoint() name after having removed the old, different
> function having the same name. This can be confusing in the first
> place to who is used to the old function, and also to anybody rebasing
> their patches on top of a new kernel to find their code behaving
> differently.
> 
> Also, as now we'd have two similar variants of this function, it would
> be good if each of them were having a name that clearly identifies in
> which way they differ from the other.
> 
> So a better name for this function would probably be
> of_graph_get_next_port_endpoint() I guess, to clearly differentiate from
> of_graph_get_next_device_endpoint().

Yes, Indeed, Thank you for pointing it !
I will update it on v4


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
  2024-01-31  6:30     ` Dmitry Baryshkov
  (?)
@ 2024-02-01  0:12       ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-01  0:12 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bryan O'Donoghue, Lad, Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Torokhov, Emma Anholt, Eugen Hristev, Florian Fainelli,
	Frank Rowand, Greg Kroah-Hartman, Hans Verkuil, Helge Deller,
	Hugues Fruchet, Jacopo Mondi, Jacopo Mondi, James Clark,
	Jaroslav Kysela, Jonathan Hunter, Kevin Hilman, Kieran Bingham,
	Kieran Bingham, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Laurent Pinchart, Liam Girdwood, Liu Ying,
	Luca Ceresoli, Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Suzuki K Poulose, Sylwester Nawrocki, Takashi Iwai,
	Thierry Reding, Thomas Zimmermann, Tim Harvey, Todor Tomov,
	Tomi Valkeinen, Yannick Fertre, Alim Akhtar, Fabio Estevam,
	Jacopo Mondi, Jernej Skrabec, Jerome Brunet, Jessica Zhang,
	Jonas Karlman, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm


Hi Dmitry

Thank you for your review

> > The return type and the variable of of_graph_get_endpoint_count()
> > should be unsigned. Tidyup it.
> 
> 'the variable'?
> 
> I'd have added a few words telling that return type can be unsigned
> because there is no error reporting for this function.

I see. v4 will be

	Because of of_graph_get_endpoint_count() doesn't report error,
	just return count of endpoint, the return type of it should be
	unsigned. Tidyup it.

Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
@ 2024-02-01  0:12       ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-01  0:12 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: dri-devel, Jaroslav Kysela, Sylwester Nawrocki, Marijn Suijten,
	linux-stm32, Jerome Brunet, linux-samsung-soc, Robert Foss,
	Dave Stevenson, Kevin Hilman, Alexander Stein,
	Uwe Kleine-König, Luca Ceresoli, Raphael Gallais-Pou,
	Sascha Hauer, Eugen Hristev, Sam Ravnborg, linux-omap, Sean Paul,
	Greg Kroah-Hartman, Nick Desaulniers, Michael Tretter,
	Sowjanya Komatineni, Hans Verkuil, freedreno, Alexandre Belloni,
	Alim Akhtar, Tomi Valkeinen, Claudiu Beznea, Lad, Prabhakar,
	Thierry Reding, James Clark, Saravana Kannan, Fabio Estevam,
	Helge Deller, Alexey Brodkin, Jonathan Hunter,
	Martin Blumenstingl, Miguel Ojeda, Jessica Zhang, linux-media,
	Jacopo Mondi, Suzuki K Poulose, Liu Ying, linux-arm-msm,
	coresight, Maxime Ripard, linux-rpi-kernel, Biju Das,
	linux-amlogic, Michal Simek, linux-arm-kernel, Neil Armstrong,
	Niklas Söderlund, linux-renesas-soc, Jacopo Mondi,
	Maxime Coquelin, Alexander Shishkin, Tom Rix, linux-fbdev,
	linux-tegra, Laurent Pinchart, Andrzej Hajda, Frank Rowand,
	linux-staging, Kieran Bingham, Jernej Skrabec,
	Bryan O'Donoghue, Jonas Karlman, Tim Harvey, Abhinav Kumar,
	Nathan Chancellor, Mark Brown, Daniel Vetter,
	Mauro Carvalho Chehab, Dmitry Torokhov, Liam Girdwood,
	Konrad Dybcio, Kieran Bingham, Sakari Ailus, Shawn Guo,
	Yannick Fertre, Emma Anholt, llvm, Alexandre Torgue, Todor Tomov,
	Takashi Iwai, Krzysztof Kozlowski, Marek Vasut, Laurent Pinchart,
	Florian Fainelli, Hugues Fruchet, Russell King, Andy Gross,
	Mike Leach, devicetree, Thomas Zimmermann, Rob Herring,
	linux-sound, Jacopo Mondi, Bjorn Andersson, Nicolas Ferre,
	Philippe Cornu, Leo Yan


Hi Dmitry

Thank you for your review

> > The return type and the variable of of_graph_get_endpoint_count()
> > should be unsigned. Tidyup it.
> 
> 'the variable'?
> 
> I'd have added a few words telling that return type can be unsigned
> because there is no error reporting for this function.

I see. v4 will be

	Because of of_graph_get_endpoint_count() doesn't report error,
	just return count of endpoint, the return type of it should be
	unsigned. Tidyup it.

Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count()
@ 2024-02-01  0:12       ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-01  0:12 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bryan O'Donoghue, Lad, Prabhakar,
	Niklas Söderlund, Uwe Kleine-König,
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Torokhov, Emma Anholt, Eugen Hristev, Florian Fainelli,
	Frank Rowand, Greg Kroah-Hartman, Hans Verkuil, Helge Deller,
	Hugues Fruchet, Jacopo Mondi, Jacopo Mondi, James Clark,
	Jaroslav Kysela, Jonathan Hunter, Kevin Hilman, Kieran Bingham,
	Kieran Bingham, Konrad Dybcio, Krzysztof Kozlowski,
	Laurent Pinchart, Laurent Pinchart, Liam Girdwood, Liu Ying,
	Luca Ceresoli, Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Suzuki K Poulose, Sylwester Nawrocki, Takashi Iwai,
	Thierry Reding, Thomas Zimmermann, Tim Harvey, Todor Tomov,
	Tomi Valkeinen, Yannick Fertre, Alim Akhtar, Fabio Estevam,
	Jacopo Mondi, Jernej Skrabec, Jerome Brunet, Jessica Zhang,
	Jonas Karlman, Leo Yan, Marijn Suijten, Martin Blumenstingl,
	Mike Leach, Sam Ravnborg, Sean Paul, Tom Rix, coresight,
	devicetree, dri-devel, freedreno, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-fbdev, linux-media,
	linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm


Hi Dmitry

Thank you for your review

> > The return type and the variable of of_graph_get_endpoint_count()
> > should be unsigned. Tidyup it.
> 
> 'the variable'?
> 
> I'd have added a few words telling that return type can be unsigned
> because there is no error reporting for this function.

I see. v4 will be

	Because of of_graph_get_endpoint_count() doesn't report error,
	just return count of endpoint, the return type of it should be
	unsigned. Tidyup it.

Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:05   ` Kuninori Morimoto
@ 2024-02-02 17:49     ` Rob Herring
  -1 siblings, 0 replies; 103+ messages in thread
From: Rob Herring @ 2024-02-02 17:49 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

On Wed, Jan 31, 2024 at 05:05:27AM +0000, Kuninori Morimoto wrote:
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/media/i2c/adv7343.c              | 2 +-
>  drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
>  drivers/media/i2c/adv7604.c              | 2 +-
>  drivers/media/i2c/isl7998x.c             | 2 +-
>  drivers/media/i2c/max9286.c              | 2 +-
>  drivers/media/i2c/mt9p031.c              | 2 +-
>  drivers/media/i2c/mt9v032.c              | 2 +-
>  drivers/media/i2c/ov2659.c               | 2 +-
>  drivers/media/i2c/ov5645.c               | 2 +-
>  drivers/media/i2c/ov5647.c               | 2 +-
>  drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
>  drivers/media/i2c/s5k5baf.c              | 2 +-
>  drivers/media/i2c/tc358743.c             | 2 +-
>  drivers/media/i2c/tda1997x.c             | 2 +-
>  drivers/media/i2c/tvp514x.c              | 2 +-
>  drivers/media/i2c/tvp5150.c              | 4 ++--
>  drivers/media/i2c/tvp7002.c              | 2 +-
>  17 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
> index ff21cd4744d3..7e4eb2f8bf0d 100644
> --- a/drivers/media/i2c/adv7343.c
> +++ b/drivers/media/i2c/adv7343.c
> @@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client)
>  	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
>  		return client->dev.platform_data;
>  
> -	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
> +	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);

This is assuming there's just 1 port and 1 endpoint, but let's be 
specific as the bindings are (first endpoint on port 0):

of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);

Note we could ask for endpoint 0 here, but the bindings generally allow 
for more than 1.

I imagine most of the other cases here are the same.

>  	if (!np)
>  		return NULL;
>  
> diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
> index 3eb6d5e8f082..4e9e4cef8954 100644
> --- a/drivers/media/i2c/adv748x/adv748x-core.c
> +++ b/drivers/media/i2c/adv748x/adv748x-core.c
> @@ -657,7 +657,7 @@ static int adv748x_parse_dt(struct adv748x_state *state)
>  	bool in_found = false;
>  	int ret;
>  
> -	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
> +	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {

I would skip the rename.

Rob

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-02 17:49     ` Rob Herring
  0 siblings, 0 replies; 103+ messages in thread
From: Rob Herring @ 2024-02-02 17:49 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

On Wed, Jan 31, 2024 at 05:05:27AM +0000, Kuninori Morimoto wrote:
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/media/i2c/adv7343.c              | 2 +-
>  drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
>  drivers/media/i2c/adv7604.c              | 2 +-
>  drivers/media/i2c/isl7998x.c             | 2 +-
>  drivers/media/i2c/max9286.c              | 2 +-
>  drivers/media/i2c/mt9p031.c              | 2 +-
>  drivers/media/i2c/mt9v032.c              | 2 +-
>  drivers/media/i2c/ov2659.c               | 2 +-
>  drivers/media/i2c/ov5645.c               | 2 +-
>  drivers/media/i2c/ov5647.c               | 2 +-
>  drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +-
>  drivers/media/i2c/s5k5baf.c              | 2 +-
>  drivers/media/i2c/tc358743.c             | 2 +-
>  drivers/media/i2c/tda1997x.c             | 2 +-
>  drivers/media/i2c/tvp514x.c              | 2 +-
>  drivers/media/i2c/tvp5150.c              | 4 ++--
>  drivers/media/i2c/tvp7002.c              | 2 +-
>  17 files changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
> index ff21cd4744d3..7e4eb2f8bf0d 100644
> --- a/drivers/media/i2c/adv7343.c
> +++ b/drivers/media/i2c/adv7343.c
> @@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client)
>  	if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
>  		return client->dev.platform_data;
>  
> -	np = of_graph_get_next_endpoint(client->dev.of_node, NULL);
> +	np = of_graph_get_next_device_endpoint(client->dev.of_node, NULL);

This is assuming there's just 1 port and 1 endpoint, but let's be 
specific as the bindings are (first endpoint on port 0):

of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);

Note we could ask for endpoint 0 here, but the bindings generally allow 
for more than 1.

I imagine most of the other cases here are the same.

>  	if (!np)
>  		return NULL;
>  
> diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
> index 3eb6d5e8f082..4e9e4cef8954 100644
> --- a/drivers/media/i2c/adv748x/adv748x-core.c
> +++ b/drivers/media/i2c/adv748x/adv748x-core.c
> @@ -657,7 +657,7 @@ static int adv748x_parse_dt(struct adv748x_state *state)
>  	bool in_found = false;
>  	int ret;
>  
> -	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
> +	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {

I would skip the rename.

Rob

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 06/24] media: platform: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:05   ` Kuninori Morimoto
@ 2024-02-02 17:56     ` Rob Herring
  -1 siblings, 0 replies; 103+ messages in thread
From: Rob Herring @ 2024-02-02 17:56 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

On Wed, Jan 31, 2024 at 05:05:34AM +0000, Kuninori Morimoto wrote:
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/media/platform/atmel/atmel-isi.c                 | 4 ++--
>  drivers/media/platform/intel/pxa_camera.c                | 2 +-
>  drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 +-
>  drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 +-
>  drivers/media/platform/qcom/camss/camss.c                | 2 +-
>  drivers/media/platform/renesas/renesas-ceu.c             | 2 +-
>  drivers/media/platform/samsung/exynos4-is/fimc-is.c      | 2 +-
>  drivers/media/platform/samsung/exynos4-is/mipi-csis.c    | 2 +-
>  drivers/media/platform/st/stm32/stm32-dcmi.c             | 4 ++--
>  drivers/media/platform/ti/am437x/am437x-vpfe.c           | 2 +-
>  drivers/media/platform/ti/davinci/vpif.c                 | 3 +--
>  drivers/media/platform/ti/davinci/vpif_capture.c         | 3 +--
>  drivers/media/platform/video-mux.c                       | 2 +-
>  drivers/media/platform/xilinx/xilinx-vipp.c              | 2 +-
>  14 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
> index 4046212d48b4..4317750d05ad 100644
> --- a/drivers/media/platform/atmel/atmel-isi.c
> +++ b/drivers/media/platform/atmel/atmel-isi.c
> @@ -831,7 +831,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
>  	isi->pdata.full_mode = 1;
>  	isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
>  
> -	np = of_graph_get_next_endpoint(np, NULL);
> +	np = of_graph_get_next_device_endpoint(np, NULL);

Same comment on using of_graph_get_endpoint_by_regs().


>  	if (!np) {
>  		dev_err(&pdev->dev, "Could not find the endpoint\n");
>  		return -EINVAL;
> @@ -1155,7 +1155,7 @@ static int isi_graph_init(struct atmel_isi *isi)
>  	struct device_node *ep;
>  	int ret;
>  
> -	ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL);
> +	ep = of_graph_get_next_device_endpoint(isi->dev->of_node, NULL);
>  	if (!ep)
>  		return -EINVAL;
>  
> diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c
> index 59b89e421dc2..f2175c03502b 100644
> --- a/drivers/media/platform/intel/pxa_camera.c
> +++ b/drivers/media/platform/intel/pxa_camera.c
> @@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
>  		pcdev->mclk = mclk_rate;
>  	}
>  
> -	np = of_graph_get_next_endpoint(np, NULL);
> +	np = of_graph_get_next_device_endpoint(np, NULL);
>  	if (!np) {
>  		dev_err(dev, "could not find endpoint\n");
>  		return -EINVAL;
> diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> index 5ac149cf3647..201049c047b0 100644
> --- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> @@ -363,7 +363,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
>  	while (1) {
>  		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
>  
> -		epn = of_graph_get_next_endpoint(np, epn);
> +		epn = of_graph_get_next_device_endpoint(np, epn);

Looks like this should use the iterator?


>  		if (!epn)
>  			return 0;
>  
> diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> index 73445f33d26b..b617a9bcd398 100644
> --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> @@ -349,7 +349,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
>  	while (1) {
>  		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
>  
> -		epn = of_graph_get_next_endpoint(np, epn);
> +		epn = of_graph_get_next_device_endpoint(np, epn);
>  		if (!epn)
>  			return 0;
>  
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 8e78dd8d5961..cbb6f88cfe4a 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -1136,7 +1136,7 @@ static int camss_of_parse_ports(struct camss *camss)
>  	struct device_node *remote = NULL;
>  	int ret, num_subdevs = 0;
>  
> -	for_each_endpoint_of_node(dev->of_node, node) {
> +	for_each_device_endpoint_of_node(dev->of_node, node) {
>  		struct camss_async_subdev *csd;
>  
>  		if (!of_device_is_available(node))
> diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
> index 2562b30acfb9..929d17de4ac9 100644
> --- a/drivers/media/platform/renesas/renesas-ceu.c
> +++ b/drivers/media/platform/renesas/renesas-ceu.c
> @@ -1526,7 +1526,7 @@ static int ceu_parse_dt(struct ceu_device *ceudev)
>  	int num_ep;
>  	int ret;
>  
> -	num_ep = of_graph_get_endpoint_count(of);
> +	num_ep = of_graph_get_device_endpoint_count(of);
>  	if (!num_ep)
>  		return -ENODEV;
>  
> diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> index a08c87ef6e2d..5ab0399b7718 100644
> --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> @@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
>  		return -EINVAL;
>  	}
>  
> -	ep = of_graph_get_next_endpoint(node, NULL);
> +	ep = of_graph_get_next_device_endpoint(node, NULL);
>  	if (!ep)
>  		return -ENXIO;
>  
> diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
> index 686ca8753ba2..a332b4bd76f2 100644
> --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
> +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
> @@ -728,7 +728,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
>  				 &state->max_num_lanes))
>  		return -EINVAL;
>  
> -	node = of_graph_get_next_endpoint(node, NULL);
> +	node = of_graph_get_next_device_endpoint(node, NULL);
>  	if (!node) {
>  		dev_err(&pdev->dev, "No port node at %pOF\n",
>  				pdev->dev.of_node);
> diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
> index 8cb4fdcae137..320101f4ad40 100644
> --- a/drivers/media/platform/st/stm32/stm32-dcmi.c
> +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
> @@ -1856,7 +1856,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi)
>  	struct device_node *ep;
>  	int ret;
>  
> -	ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL);
> +	ep = of_graph_get_next_device_endpoint(dcmi->dev->of_node, NULL);
>  	if (!ep) {
>  		dev_err(dcmi->dev, "Failed to get next endpoint\n");
>  		return -EINVAL;
> @@ -1915,7 +1915,7 @@ static int dcmi_probe(struct platform_device *pdev)
>  				     "Could not get reset control\n");
>  
>  	/* Get bus characteristics from devicetree */
> -	np = of_graph_get_next_endpoint(np, NULL);
> +	np = of_graph_get_next_device_endpoint(np, NULL);
>  	if (!np) {
>  		dev_err(&pdev->dev, "Could not find the endpoint\n");
>  		return -ENODEV;
> diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> index 5fa2ea9025d9..46876865ec6a 100644
> --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> @@ -2309,7 +2309,7 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
>  		struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
>  		struct device_node *rem;
>  
> -		endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint);
> +		endpoint = of_graph_get_next_device_endpoint(dev->of_node, endpoint);
>  		if (!endpoint)
>  			break;
>  
> diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c
> index 63cdfed37bc9..021ca79e832b 100644
> --- a/drivers/media/platform/ti/davinci/vpif.c
> +++ b/drivers/media/platform/ti/davinci/vpif.c
> @@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev)
>  	 * so their devices need to be registered manually here
>  	 * for their legacy platform_drivers to work.
>  	 */
> -	endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
> -					      endpoint);
> +	endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
>  	if (!endpoint)
>  		return 0;
>  	of_node_put(endpoint);
> diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
> index 99fae8830c41..805c313b41dc 100644
> --- a/drivers/media/platform/ti/davinci/vpif_capture.c
> +++ b/drivers/media/platform/ti/davinci/vpif_capture.c
> @@ -1521,8 +1521,7 @@ vpif_capture_get_pdata(struct platform_device *pdev,
>  		unsigned int flags;
>  		int err;
>  
> -		endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
> -						      endpoint);
> +		endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
>  		if (!endpoint)
>  			break;
>  
> diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
> index 5de6b6694f53..61d84ade7155 100644
> --- a/drivers/media/platform/video-mux.c
> +++ b/drivers/media/platform/video-mux.c
> @@ -408,7 +408,7 @@ static int video_mux_probe(struct platform_device *pdev)
>  	 * The largest numbered port is the output port. It determines
>  	 * total number of pads.
>  	 */
> -	for_each_endpoint_of_node(np, ep) {
> +	for_each_device_endpoint_of_node(np, ep) {
>  		struct of_endpoint endpoint;
>  
>  		of_graph_parse_endpoint(ep, &endpoint);
> diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
> index 996684a73038..9230931d6d7a 100644
> --- a/drivers/media/platform/xilinx/xilinx-vipp.c
> +++ b/drivers/media/platform/xilinx/xilinx-vipp.c
> @@ -207,7 +207,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
>  
>  	while (1) {
>  		/* Get the next endpoint and parse its link. */
> -		ep = of_graph_get_next_endpoint(node, ep);
> +		ep = of_graph_get_next_device_endpoint(node, ep);

The rest of this file uses fwnode versions including the very next 
function. This should be fwnode_graph_get_next_endpoint(). But then it's 
a loop, so should be a loop iterator instead.

Rob

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

* Re: [PATCH v3 06/24] media: platform: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-02 17:56     ` Rob Herring
  0 siblings, 0 replies; 103+ messages in thread
From: Rob Herring @ 2024-02-02 17:56 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

On Wed, Jan 31, 2024 at 05:05:34AM +0000, Kuninori Morimoto wrote:
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  drivers/media/platform/atmel/atmel-isi.c                 | 4 ++--
>  drivers/media/platform/intel/pxa_camera.c                | 2 +-
>  drivers/media/platform/microchip/microchip-sama5d2-isc.c | 2 +-
>  drivers/media/platform/microchip/microchip-sama7g5-isc.c | 2 +-
>  drivers/media/platform/qcom/camss/camss.c                | 2 +-
>  drivers/media/platform/renesas/renesas-ceu.c             | 2 +-
>  drivers/media/platform/samsung/exynos4-is/fimc-is.c      | 2 +-
>  drivers/media/platform/samsung/exynos4-is/mipi-csis.c    | 2 +-
>  drivers/media/platform/st/stm32/stm32-dcmi.c             | 4 ++--
>  drivers/media/platform/ti/am437x/am437x-vpfe.c           | 2 +-
>  drivers/media/platform/ti/davinci/vpif.c                 | 3 +--
>  drivers/media/platform/ti/davinci/vpif_capture.c         | 3 +--
>  drivers/media/platform/video-mux.c                       | 2 +-
>  drivers/media/platform/xilinx/xilinx-vipp.c              | 2 +-
>  14 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
> index 4046212d48b4..4317750d05ad 100644
> --- a/drivers/media/platform/atmel/atmel-isi.c
> +++ b/drivers/media/platform/atmel/atmel-isi.c
> @@ -831,7 +831,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
>  	isi->pdata.full_mode = 1;
>  	isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
>  
> -	np = of_graph_get_next_endpoint(np, NULL);
> +	np = of_graph_get_next_device_endpoint(np, NULL);

Same comment on using of_graph_get_endpoint_by_regs().


>  	if (!np) {
>  		dev_err(&pdev->dev, "Could not find the endpoint\n");
>  		return -EINVAL;
> @@ -1155,7 +1155,7 @@ static int isi_graph_init(struct atmel_isi *isi)
>  	struct device_node *ep;
>  	int ret;
>  
> -	ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL);
> +	ep = of_graph_get_next_device_endpoint(isi->dev->of_node, NULL);
>  	if (!ep)
>  		return -EINVAL;
>  
> diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c
> index 59b89e421dc2..f2175c03502b 100644
> --- a/drivers/media/platform/intel/pxa_camera.c
> +++ b/drivers/media/platform/intel/pxa_camera.c
> @@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
>  		pcdev->mclk = mclk_rate;
>  	}
>  
> -	np = of_graph_get_next_endpoint(np, NULL);
> +	np = of_graph_get_next_device_endpoint(np, NULL);
>  	if (!np) {
>  		dev_err(dev, "could not find endpoint\n");
>  		return -EINVAL;
> diff --git a/drivers/media/platform/microchip/microchip-sama5d2-isc.c b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> index 5ac149cf3647..201049c047b0 100644
> --- a/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama5d2-isc.c
> @@ -363,7 +363,7 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)
>  	while (1) {
>  		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
>  
> -		epn = of_graph_get_next_endpoint(np, epn);
> +		epn = of_graph_get_next_device_endpoint(np, epn);

Looks like this should use the iterator?


>  		if (!epn)
>  			return 0;
>  
> diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> index 73445f33d26b..b617a9bcd398 100644
> --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c
> @@ -349,7 +349,7 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc)
>  	while (1) {
>  		struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 };
>  
> -		epn = of_graph_get_next_endpoint(np, epn);
> +		epn = of_graph_get_next_device_endpoint(np, epn);
>  		if (!epn)
>  			return 0;
>  
> diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
> index 8e78dd8d5961..cbb6f88cfe4a 100644
> --- a/drivers/media/platform/qcom/camss/camss.c
> +++ b/drivers/media/platform/qcom/camss/camss.c
> @@ -1136,7 +1136,7 @@ static int camss_of_parse_ports(struct camss *camss)
>  	struct device_node *remote = NULL;
>  	int ret, num_subdevs = 0;
>  
> -	for_each_endpoint_of_node(dev->of_node, node) {
> +	for_each_device_endpoint_of_node(dev->of_node, node) {
>  		struct camss_async_subdev *csd;
>  
>  		if (!of_device_is_available(node))
> diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
> index 2562b30acfb9..929d17de4ac9 100644
> --- a/drivers/media/platform/renesas/renesas-ceu.c
> +++ b/drivers/media/platform/renesas/renesas-ceu.c
> @@ -1526,7 +1526,7 @@ static int ceu_parse_dt(struct ceu_device *ceudev)
>  	int num_ep;
>  	int ret;
>  
> -	num_ep = of_graph_get_endpoint_count(of);
> +	num_ep = of_graph_get_device_endpoint_count(of);
>  	if (!num_ep)
>  		return -ENODEV;
>  
> diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> index a08c87ef6e2d..5ab0399b7718 100644
> --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
> @@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
>  		return -EINVAL;
>  	}
>  
> -	ep = of_graph_get_next_endpoint(node, NULL);
> +	ep = of_graph_get_next_device_endpoint(node, NULL);
>  	if (!ep)
>  		return -ENXIO;
>  
> diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
> index 686ca8753ba2..a332b4bd76f2 100644
> --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
> +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
> @@ -728,7 +728,7 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
>  				 &state->max_num_lanes))
>  		return -EINVAL;
>  
> -	node = of_graph_get_next_endpoint(node, NULL);
> +	node = of_graph_get_next_device_endpoint(node, NULL);
>  	if (!node) {
>  		dev_err(&pdev->dev, "No port node at %pOF\n",
>  				pdev->dev.of_node);
> diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
> index 8cb4fdcae137..320101f4ad40 100644
> --- a/drivers/media/platform/st/stm32/stm32-dcmi.c
> +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
> @@ -1856,7 +1856,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi)
>  	struct device_node *ep;
>  	int ret;
>  
> -	ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL);
> +	ep = of_graph_get_next_device_endpoint(dcmi->dev->of_node, NULL);
>  	if (!ep) {
>  		dev_err(dcmi->dev, "Failed to get next endpoint\n");
>  		return -EINVAL;
> @@ -1915,7 +1915,7 @@ static int dcmi_probe(struct platform_device *pdev)
>  				     "Could not get reset control\n");
>  
>  	/* Get bus characteristics from devicetree */
> -	np = of_graph_get_next_endpoint(np, NULL);
> +	np = of_graph_get_next_device_endpoint(np, NULL);
>  	if (!np) {
>  		dev_err(&pdev->dev, "Could not find the endpoint\n");
>  		return -ENODEV;
> diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> index 5fa2ea9025d9..46876865ec6a 100644
> --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c
> @@ -2309,7 +2309,7 @@ vpfe_get_pdata(struct vpfe_device *vpfe)
>  		struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
>  		struct device_node *rem;
>  
> -		endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint);
> +		endpoint = of_graph_get_next_device_endpoint(dev->of_node, endpoint);
>  		if (!endpoint)
>  			break;
>  
> diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c
> index 63cdfed37bc9..021ca79e832b 100644
> --- a/drivers/media/platform/ti/davinci/vpif.c
> +++ b/drivers/media/platform/ti/davinci/vpif.c
> @@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev)
>  	 * so their devices need to be registered manually here
>  	 * for their legacy platform_drivers to work.
>  	 */
> -	endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
> -					      endpoint);
> +	endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
>  	if (!endpoint)
>  		return 0;
>  	of_node_put(endpoint);
> diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
> index 99fae8830c41..805c313b41dc 100644
> --- a/drivers/media/platform/ti/davinci/vpif_capture.c
> +++ b/drivers/media/platform/ti/davinci/vpif_capture.c
> @@ -1521,8 +1521,7 @@ vpif_capture_get_pdata(struct platform_device *pdev,
>  		unsigned int flags;
>  		int err;
>  
> -		endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
> -						      endpoint);
> +		endpoint = of_graph_get_next_device_endpoint(pdev->dev.of_node, endpoint);
>  		if (!endpoint)
>  			break;
>  
> diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c
> index 5de6b6694f53..61d84ade7155 100644
> --- a/drivers/media/platform/video-mux.c
> +++ b/drivers/media/platform/video-mux.c
> @@ -408,7 +408,7 @@ static int video_mux_probe(struct platform_device *pdev)
>  	 * The largest numbered port is the output port. It determines
>  	 * total number of pads.
>  	 */
> -	for_each_endpoint_of_node(np, ep) {
> +	for_each_device_endpoint_of_node(np, ep) {
>  		struct of_endpoint endpoint;
>  
>  		of_graph_parse_endpoint(ep, &endpoint);
> diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
> index 996684a73038..9230931d6d7a 100644
> --- a/drivers/media/platform/xilinx/xilinx-vipp.c
> +++ b/drivers/media/platform/xilinx/xilinx-vipp.c
> @@ -207,7 +207,7 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
>  
>  	while (1) {
>  		/* Get the next endpoint and parse its link. */
> -		ep = of_graph_get_next_endpoint(node, ep);
> +		ep = of_graph_get_next_device_endpoint(node, ep);

The rest of this file uses fwnode versions including the very next 
function. This should be fwnode_graph_get_next_endpoint(). But then it's 
a loop, so should be a loop iterator instead.

Rob

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 08/24] hwtracing: switch to use of_graph_get_next_device_endpoint()
  2024-01-31  5:05   ` Kuninori Morimoto
@ 2024-02-02 18:01     ` Suzuki K Poulose
  -1 siblings, 0 replies; 103+ messages in thread
From: Suzuki K Poulose @ 2024-02-02 18:01 UTC (permalink / raw)
  To: Kuninori Morimoto, Lad, Prabhakar, Niklas Söderlund,
	Uwe Kleine-König, Abhinav Kumar, Alexander Shishkin,
	Alexander Stein, Alexandre Belloni, Alexandre Torgue,
	Alexey Brodkin, Andrzej Hajda, Andy Gross, Biju Das,
	Bjorn Andersson, Claudiu Beznea, Daniel Vetter, Dave Stevenson,
	David Airlie, Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt,
	Eugen Hristev, Florian Fainelli, Frank Rowand,
	Greg Kroah-Hartman, Hans Verkuil, Helge Deller, Hugues Fruchet,
	Jacopo Mondi, Jacopo Mondi, James Clark, Jaroslav Kysela,
	Jonathan Hunter, Kevin Hilman, Kieran Bingham, Kieran Bingham,
	Konrad Dybcio, Krzysztof Kozlowski, Laurent Pinchart,
	Laurent Pinchart, Liam Girdwood, Liu Ying, Luca Ceresoli,
	Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Leo Yan,
	Marijn Suijten, Martin Blumenstingl, Mike Leach, Sam Ravnborg,
	Sean Paul, Tom Rix, coresight, devicetree, dri-devel, freedreno,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-fbdev,
	linux-media, linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm

On 31/01/2024 05:05, Kuninori Morimoto wrote:
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>   drivers/hwtracing/coresight/coresight-platform.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
> index 9d550f5697fa..944b2e66c04e 100644
> --- a/drivers/hwtracing/coresight/coresight-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-platform.c
> @@ -275,7 +275,7 @@ static int of_get_coresight_platform_data(struct device *dev,
>   	 */
>   	if (!parent) {
>   		/*
> -		 * Avoid warnings in of_graph_get_next_endpoint()
> +		 * Avoid warnings in of_graph_get_next_device_endpoint()
>   		 * if the device doesn't have any graph connections
>   		 */
>   		if (!of_graph_is_present(node))
> @@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct device *dev,
>   	}
>   
>   	/* Iterate through each output port to discover topology */
> -	while ((ep = of_graph_get_next_endpoint(parent, ep))) {
> +	while ((ep = of_graph_get_next_device_endpoint(parent, ep))) {
>   		/*
>   		 * Legacy binding mixes input/output ports under the
>   		 * same parent. So, skip the input ports if we are dealing

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>



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

* Re: [PATCH v3 08/24] hwtracing: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-02 18:01     ` Suzuki K Poulose
  0 siblings, 0 replies; 103+ messages in thread
From: Suzuki K Poulose @ 2024-02-02 18:01 UTC (permalink / raw)
  To: Kuninori Morimoto, Lad, Prabhakar, Niklas Söderlund,
	Uwe Kleine-König, Abhinav Kumar, Alexander Shishkin,
	Alexander Stein, Alexandre Belloni, Alexandre Torgue,
	Alexey Brodkin, Andrzej Hajda, Andy Gross, Biju Das,
	Bjorn Andersson, Claudiu Beznea, Daniel Vetter, Dave Stevenson,
	David Airlie, Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt,
	Eugen Hristev, Florian Fainelli, Frank Rowand,
	Greg Kroah-Hartman, Hans Verkuil, Helge Deller, Hugues Fruchet,
	Jacopo Mondi, Jacopo Mondi, James Clark, Jaroslav Kysela,
	Jonathan Hunter, Kevin Hilman, Kieran Bingham, Kieran Bingham,
	Konrad Dybcio, Krzysztof Kozlowski, Laurent Pinchart,
	Laurent Pinchart, Liam Girdwood, Liu Ying, Luca Ceresoli,
	Maarten Lankhorst, Marek Vasut, Mark Brown,
	Mauro Carvalho Chehab, Maxime Coquelin, Maxime Ripard,
	Michael Tretter, Michal Simek, Miguel Ojeda, Nathan Chancellor,
	Neil Armstrong, Nick Desaulniers, Nicolas Ferre, Philipp Zabel,
	Philippe Cornu, Raphael Gallais-Pou, Rob Clark, Rob Herring,
	Robert Foss, Russell King, Sakari Ailus, Saravana Kannan,
	Sascha Hauer, Shawn Guo, Sowjanya Komatineni, Stefan Agner,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre
  Cc: Alim Akhtar, Fabio Estevam, Jacopo Mondi, Jernej Skrabec,
	Jerome Brunet, Jessica Zhang, Jonas Karlman, Leo Yan,
	Marijn Suijten, Martin Blumenstingl, Mike Leach, Sam Ravnborg,
	Sean Paul, Tom Rix, coresight, devicetree, dri-devel, freedreno,
	linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-fbdev,
	linux-media, linux-omap, linux-renesas-soc, linux-rpi-kernel,
	linux-samsung-soc, linux-sound, linux-staging, linux-stm32,
	linux-tegra, llvm

On 31/01/2024 05:05, Kuninori Morimoto wrote:
> of_graph_get_next_endpoint() is now renamed to
> of_graph_get_next_device_endpoint(). Switch to it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>   drivers/hwtracing/coresight/coresight-platform.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
> index 9d550f5697fa..944b2e66c04e 100644
> --- a/drivers/hwtracing/coresight/coresight-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-platform.c
> @@ -275,7 +275,7 @@ static int of_get_coresight_platform_data(struct device *dev,
>   	 */
>   	if (!parent) {
>   		/*
> -		 * Avoid warnings in of_graph_get_next_endpoint()
> +		 * Avoid warnings in of_graph_get_next_device_endpoint()
>   		 * if the device doesn't have any graph connections
>   		 */
>   		if (!of_graph_is_present(node))
> @@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct device *dev,
>   	}
>   
>   	/* Iterate through each output port to discover topology */
> -	while ((ep = of_graph_get_next_endpoint(parent, ep))) {
> +	while ((ep = of_graph_get_next_device_endpoint(parent, ep))) {
>   		/*
>   		 * Legacy binding mixes input/output ports under the
>   		 * same parent. So, skip the input ports if we are dealing

Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>



_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
  2024-02-02 17:49     ` Rob Herring
@ 2024-02-04 23:44       ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-04 23:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm


Hi Rob

> This is assuming there's just 1 port and 1 endpoint, but let's be 
> specific as the bindings are (first endpoint on port 0):
> 
> of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);
> 
> Note we could ask for endpoint 0 here, but the bindings generally allow 
> for more than 1.
> 
> I imagine most of the other cases here are the same.

I will do it on new patch-set

> > -	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
> > +	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
> 
> I would skip the rename.

It is needed to avoid confuse, because new function will add
another endpoint loop.

see
https://lore.kernel.org/r/20240131100701.754a95ee@booty


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-04 23:44       ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-04 23:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm


Hi Rob

> This is assuming there's just 1 port and 1 endpoint, but let's be 
> specific as the bindings are (first endpoint on port 0):
> 
> of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);
> 
> Note we could ask for endpoint 0 here, but the bindings generally allow 
> for more than 1.
> 
> I imagine most of the other cases here are the same.

I will do it on new patch-set

> > -	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
> > +	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
> 
> I would skip the rename.

It is needed to avoid confuse, because new function will add
another endpoint loop.

see
https://lore.kernel.org/r/20240131100701.754a95ee@booty


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
  2024-02-04 23:44       ` Kuninori Morimoto
@ 2024-02-05 16:55         ` Rob Herring
  -1 siblings, 0 replies; 103+ messages in thread
From: Rob Herring @ 2024-02-05 16:55 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

On Sun, Feb 04, 2024 at 11:44:39PM +0000, Kuninori Morimoto wrote:
> 
> Hi Rob
> 
> > This is assuming there's just 1 port and 1 endpoint, but let's be 
> > specific as the bindings are (first endpoint on port 0):
> > 
> > of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);
> > 
> > Note we could ask for endpoint 0 here, but the bindings generally allow 
> > for more than 1.
> > 
> > I imagine most of the other cases here are the same.
> 
> I will do it on new patch-set
> 
> > > -	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
> > > +	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
> > 
> > I would skip the rename.
> 
> It is needed to avoid confuse, because new function will add
> another endpoint loop.
> 
> see
> https://lore.kernel.org/r/20240131100701.754a95ee@booty

I've read the threads already and think you should skip the rename. Just 
put 'port' in the name of the new one. That and taking a port number 
param should be enough distinction.

Rob

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-05 16:55         ` Rob Herring
  0 siblings, 0 replies; 103+ messages in thread
From: Rob Herring @ 2024-02-05 16:55 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

On Sun, Feb 04, 2024 at 11:44:39PM +0000, Kuninori Morimoto wrote:
> 
> Hi Rob
> 
> > This is assuming there's just 1 port and 1 endpoint, but let's be 
> > specific as the bindings are (first endpoint on port 0):
> > 
> > of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);
> > 
> > Note we could ask for endpoint 0 here, but the bindings generally allow 
> > for more than 1.
> > 
> > I imagine most of the other cases here are the same.
> 
> I will do it on new patch-set
> 
> > > -	for_each_endpoint_of_node(state->dev->of_node, ep_np) {
> > > +	for_each_device_endpoint_of_node(state->dev->of_node, ep_np) {
> > 
> > I would skip the rename.
> 
> It is needed to avoid confuse, because new function will add
> another endpoint loop.
> 
> see
> https://lore.kernel.org/r/20240131100701.754a95ee@booty

I've read the threads already and think you should skip the rename. Just 
put 'port' in the name of the new one. That and taking a port number 
param should be enough distinction.

Rob

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
  2024-02-05 16:55         ` Rob Herring
@ 2024-02-05 23:34           ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-05 23:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Hi Rob

> I've read the threads already and think you should skip the rename. Just 
> put 'port' in the name of the new one.

OK

> That and taking a port number param should be enough distinction.

I think we want to use "port" directly instead of "port number"
on new function.

Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-05 23:34           ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-05 23:34 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm

Hi Rob

> I've read the threads already and think you should skip the rename. Just 
> put 'port' in the name of the new one.

OK

> That and taking a port number param should be enough distinction.

I think we want to use "port" directly instead of "port number"
on new function.

Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
  2024-02-04 23:44       ` Kuninori Morimoto
@ 2024-02-06  2:06         ` Kuninori Morimoto
  -1 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-06  2:06 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm


Hi Rob, again

> > This is assuming there's just 1 port and 1 endpoint, but let's be 
> > specific as the bindings are (first endpoint on port 0):
> > 
> > of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);
> > 
> > Note we could ask for endpoint 0 here, but the bindings generally allow 
> > for more than 1.
> > 
> > I imagine most of the other cases here are the same.

I'm bit confused here.
You mentioned that -1 is wrong in previous mail.

	Most cases are in the form of of_graph_get_next_endpoint(dev, NULL) 
	which is equivalent to of_graph_get_endpoint_by_regs(dev, 0, 0). 
	Technically, -1 instead of 0 is equivalent, but I'd argue is sloppy and 
	wrong.

But you mentioned -1 here, So, I will use it on next patch-set.


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

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

* Re: [PATCH v3 05/24] media: i2c: switch to use of_graph_get_next_device_endpoint()
@ 2024-02-06  2:06         ` Kuninori Morimoto
  0 siblings, 0 replies; 103+ messages in thread
From: Kuninori Morimoto @ 2024-02-06  2:06 UTC (permalink / raw)
  To: Rob Herring
  Cc: Bryan O'Donoghue, Lad,  Prabhakar,
	"Niklas Söderlund",
	"Uwe Kleine-König",
	Abhinav Kumar, Alexander Shishkin, Alexander Stein,
	Alexandre Belloni, Alexandre Torgue, Alexey Brodkin,
	Andrzej Hajda, Andy Gross, Biju Das, Bjorn Andersson,
	Claudiu Beznea, Daniel Vetter, Dave Stevenson, David Airlie,
	Dmitry Baryshkov, Dmitry Torokhov, Emma Anholt, Eugen Hristev,
	Florian Fainelli, Frank Rowand, Greg Kroah-Hartman, Hans Verkuil,
	Helge Deller, Hugues Fruchet, Jacopo Mondi, Jacopo Mondi,
	James Clark, Jaroslav Kysela, Jonathan Hunter, Kevin Hilman,
	Kieran Bingham, Kieran Bingham, Konrad Dybcio,
	Krzysztof Kozlowski, Laurent Pinchart, Laurent Pinchart,
	Liam Girdwood, Liu Ying, Luca Ceresoli, Maarten Lankhorst,
	Marek Vasut, Mark Brown, Mauro Carvalho Chehab, Maxime Coquelin,
	Maxime Ripard, Michael Tretter, Michal Simek, Miguel Ojeda,
	Nathan Chancellor, Neil Armstrong, Nick Desaulniers,
	Nicolas Ferre, Philipp Zabel, Philippe Cornu,
	Raphael Gallais-Pou, Rob Clark, Robert Foss, Russell King,
	Sakari Ailus, Saravana Kannan, Sascha Hauer, Shawn Guo,
	Sowjanya Komatineni, Stefan Agner, Suzuki K Poulose,
	Sylwester Nawrocki, Takashi Iwai, Thierry Reding,
	Thomas Zimmermann, Tim Harvey, Todor Tomov, Tomi Valkeinen,
	Yannick Fertre, Alim Akhtar, Fabio Estevam, Jacopo Mondi,
	Jernej Skrabec, Jerome Brunet, Jessica Zhang, Jonas Karlman,
	Leo Yan, Marijn Suijten, Martin Blumenstingl, Mike Leach,
	Sam Ravnborg, Sean Paul, Tom Rix, coresight, devicetree,
	dri-devel, freedreno, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-fbdev, linux-media, linux-omap,
	linux-renesas-soc, linux-rpi-kernel, linux-samsung-soc,
	linux-sound, linux-staging, linux-stm32, linux-tegra, llvm


Hi Rob, again

> > This is assuming there's just 1 port and 1 endpoint, but let's be 
> > specific as the bindings are (first endpoint on port 0):
> > 
> > of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1);
> > 
> > Note we could ask for endpoint 0 here, but the bindings generally allow 
> > for more than 1.
> > 
> > I imagine most of the other cases here are the same.

I'm bit confused here.
You mentioned that -1 is wrong in previous mail.

	Most cases are in the form of of_graph_get_next_endpoint(dev, NULL) 
	which is equivalent to of_graph_get_endpoint_by_regs(dev, 0, 0). 
	Technically, -1 instead of 0 is equivalent, but I'd argue is sloppy and 
	wrong.

But you mentioned -1 here, So, I will use it on next patch-set.


Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2024-02-23 17:14 UTC | newest]

Thread overview: 103+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31  5:04 [PATCH v3 00/24] of: property: add port base loop Kuninori Morimoto
2024-01-31  5:04 ` Kuninori Morimoto
2024-01-31  5:04 ` [PATCH v3 01/24] of: property: add missing kerneldoc for of_graph_get_endpoint_count() Kuninori Morimoto
2024-01-31  5:04   ` Kuninori Morimoto
2024-01-31  5:04   ` Kuninori Morimoto
2024-01-31  5:05 ` [PATCH v3 02/24] of: property: use unsigned int return on of_graph_get_endpoint_count() Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  6:30   ` Dmitry Baryshkov
2024-01-31  6:30     ` Dmitry Baryshkov
2024-01-31  6:30     ` Dmitry Baryshkov
2024-02-01  0:12     ` Kuninori Morimoto
2024-02-01  0:12       ` Kuninori Morimoto
2024-02-01  0:12       ` Kuninori Morimoto
2024-01-31  5:05 ` [PATCH v3 03/24] of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint() Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05 ` [PATCH v3 04/24] video: fbdev: switch to use of_graph_get_next_device_endpoint() Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05 ` [PATCH v3 05/24] media: i2c: " Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-02-02 17:49   ` Rob Herring
2024-02-02 17:49     ` Rob Herring
2024-02-04 23:44     ` Kuninori Morimoto
2024-02-04 23:44       ` Kuninori Morimoto
2024-02-05 16:55       ` Rob Herring
2024-02-05 16:55         ` Rob Herring
2024-02-05 23:34         ` Kuninori Morimoto
2024-02-05 23:34           ` Kuninori Morimoto
2024-02-06  2:06       ` Kuninori Morimoto
2024-02-06  2:06         ` Kuninori Morimoto
2024-01-31  5:05 ` [PATCH v3 06/24] media: platform: " Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-02-02 17:56   ` Rob Herring
2024-02-02 17:56     ` Rob Herring
2024-01-31  5:05 ` [PATCH v3 07/24] gpu: drm: " Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  6:32   ` Dmitry Baryshkov
2024-01-31  6:32     ` Dmitry Baryshkov
2024-01-31  6:32     ` Dmitry Baryshkov
2024-01-31  5:05 ` [PATCH v3 08/24] hwtracing: " Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-02-02 18:01   ` Suzuki K Poulose
2024-02-02 18:01     ` Suzuki K Poulose
2024-01-31  5:05 ` [PATCH v3 09/24] staging: " Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:05   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 10/24] ASoC: " Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 11/24] of: remove of_graph_get_next_endpoint() define Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 12/24] of: property: add port base loop Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 13/24] of: property: use of_graph_get_next_port() on of_graph_get_next_endpoint() Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 14/24] of: property: add of_graph_get_next_endpoint() Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  9:07   ` Luca Ceresoli
2024-01-31  9:07     ` Luca Ceresoli
2024-01-31  9:07     ` Luca Ceresoli
2024-01-31 23:26     ` Kuninori Morimoto
2024-01-31 23:26       ` Kuninori Morimoto
2024-01-31 23:26       ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 15/24] drm: omapdrm: use of_graph_get_next_endpoint() Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 16/24] media: xilinx-tpg: " Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06 ` [PATCH v3 17/24] ASoC: audio-graph-card: " Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:06   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 18/24] ASoC: audio-graph-card2: use of_graph_get_next_port() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 19/24] ASoC: audio-graph-card2: use of_graph_get_next_endpoint() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 20/24] ASoC: test-component: use for_each_port_of_node() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 21/24] fbdev: omapfb: use of_graph_get_remote_port() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 22/24] fbdev: omapfb: use of_graph_get_next_port() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 23/24] fbdev: omapfb: use of_graph_get_next_endpoint() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07 ` [PATCH v3 24/24] fbdev: omapfb: use of_graph_get_next_device_endpoint() Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto
2024-01-31  5:07   ` Kuninori Morimoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.