Skip to content

Commit 5848915

Browse files
morimotoHans Verkuil
authored andcommitted
media: platform: replace of_graph_get_next_endpoint()
From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent c188df3 commit 5848915

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

drivers/media/platform/atmel/atmel-isi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,
834834
isi->pdata.full_mode = 1;
835835
isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
836836

837-
np = of_graph_get_next_endpoint(np, NULL);
837+
np = of_graph_get_endpoint_by_regs(np, 0, -1);
838838
if (!np) {
839839
dev_err(&pdev->dev, "Could not find the endpoint\n");
840840
return -EINVAL;
@@ -1158,7 +1158,7 @@ static int isi_graph_init(struct atmel_isi *isi)
11581158
struct device_node *ep;
11591159
int ret;
11601160

1161-
ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL);
1161+
ep = of_graph_get_endpoint_by_regs(isi->dev->of_node, 0, -1);
11621162
if (!ep)
11631163
return -EINVAL;
11641164

drivers/media/platform/intel/pxa_camera.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev,
22072207
pcdev->mclk = mclk_rate;
22082208
}
22092209

2210-
np = of_graph_get_next_endpoint(np, NULL);
2210+
np = of_graph_get_endpoint_by_regs(np, 0, -1);
22112211
if (!np) {
22122212
dev_err(dev, "could not find endpoint\n");
22132213
return -EINVAL;

drivers/media/platform/samsung/exynos4-is/fimc-is.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
175175
return -EINVAL;
176176
}
177177

178-
ep = of_graph_get_next_endpoint(node, NULL);
178+
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
179179
if (!ep)
180180
return -ENXIO;
181181

drivers/media/platform/samsung/exynos4-is/mipi-csis.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,8 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
727727
&state->max_num_lanes))
728728
return -EINVAL;
729729

730-
node = of_graph_get_next_endpoint(node, NULL);
730+
/* from port@3 or port@4 */
731+
node = of_graph_get_endpoint_by_regs(node, -1, -1);
731732
if (!node) {
732733
dev_err(&pdev->dev, "No port node at %pOF\n",
733734
pdev->dev.of_node);

drivers/media/platform/st/stm32/stm32-dcmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi)
18551855
struct device_node *ep;
18561856
int ret;
18571857

1858-
ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL);
1858+
ep = of_graph_get_endpoint_by_regs(dcmi->dev->of_node, 0, -1);
18591859
if (!ep) {
18601860
dev_err(dcmi->dev, "Failed to get next endpoint\n");
18611861
return -EINVAL;
@@ -1907,7 +1907,7 @@ static int dcmi_probe(struct platform_device *pdev)
19071907
"Could not get reset control\n");
19081908

19091909
/* Get bus characteristics from devicetree */
1910-
np = of_graph_get_next_endpoint(np, NULL);
1910+
np = of_graph_get_endpoint_by_regs(np, 0, -1);
19111911
if (!np) {
19121912
dev_err(&pdev->dev, "Could not find the endpoint\n");
19131913
return -ENODEV;

drivers/media/platform/ti/davinci/vpif.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev)
465465
* so their devices need to be registered manually here
466466
* for their legacy platform_drivers to work.
467467
*/
468-
endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
469-
endpoint);
468+
endpoint = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1);
470469
if (!endpoint)
471470
return 0;
472471
of_node_put(endpoint);

0 commit comments

Comments
 (0)