diff mbox series

[v3,06/24] media: platform: switch to use of_graph_get_next_device_endpoint()

Message ID 87frye6qjl.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series of: property: add port base loop | expand

Commit Message

Kuninori Morimoto Jan. 31, 2024, 5:05 a.m. UTC
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(-)

Comments

Rob Herring (Arm) Feb. 2, 2024, 5:56 p.m. UTC | #1
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
diff mbox series

Patch

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;