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/20240202174941.GA310089-robh@kernel.org Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
c188df3db1
commit
5848915b91
@ -834,7 +834,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_endpoint_by_regs(np, 0, -1);
|
||||
if (!np) {
|
||||
dev_err(&pdev->dev, "Could not find the endpoint\n");
|
||||
return -EINVAL;
|
||||
@ -1158,7 +1158,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_endpoint_by_regs(isi->dev->of_node, 0, -1);
|
||||
if (!ep)
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -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_endpoint_by_regs(np, 0, -1);
|
||||
if (!np) {
|
||||
dev_err(dev, "could not find endpoint\n");
|
||||
return -EINVAL;
|
||||
|
@ -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_endpoint_by_regs(node, 0, -1);
|
||||
if (!ep)
|
||||
return -ENXIO;
|
||||
|
||||
|
@ -727,7 +727,8 @@ static int s5pcsis_parse_dt(struct platform_device *pdev,
|
||||
&state->max_num_lanes))
|
||||
return -EINVAL;
|
||||
|
||||
node = of_graph_get_next_endpoint(node, NULL);
|
||||
/* from port@3 or port@4 */
|
||||
node = of_graph_get_endpoint_by_regs(node, -1, -1);
|
||||
if (!node) {
|
||||
dev_err(&pdev->dev, "No port node at %pOF\n",
|
||||
pdev->dev.of_node);
|
||||
|
@ -1855,7 +1855,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_endpoint_by_regs(dcmi->dev->of_node, 0, -1);
|
||||
if (!ep) {
|
||||
dev_err(dcmi->dev, "Failed to get next endpoint\n");
|
||||
return -EINVAL;
|
||||
@ -1907,7 +1907,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_endpoint_by_regs(np, 0, -1);
|
||||
if (!np) {
|
||||
dev_err(&pdev->dev, "Could not find the endpoint\n");
|
||||
return -ENODEV;
|
||||
|
@ -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_endpoint_by_regs(pdev->dev.of_node, 0, -1);
|
||||
if (!endpoint)
|
||||
return 0;
|
||||
of_node_put(endpoint);
|
||||
|
Loading…
x
Reference in New Issue
Block a user