Commit 53bff803 authored by Philipp Zabel's avatar Philipp Zabel Committed by Greg Kroah-Hartman

gpu: ipu-v3: Do not bail out on missing optional port nodes

commit 17e05217 upstream.

The port nodes are documented as optional, treat them accordingly.
Reported-by: default avatarMartin Fuzzey <mfuzzey@parkeon.com>
Reported-by: default avatarChris Healy <Chris.Healy@zii.aero>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Fixes: 304e6be6 ("gpu: ipu-v3: Assign of_node of child platform devices to corresponding ports")
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ded9853a
...@@ -1050,6 +1050,17 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base) ...@@ -1050,6 +1050,17 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
for (i = 0; i < ARRAY_SIZE(client_reg); i++) { for (i = 0; i < ARRAY_SIZE(client_reg); i++) {
const struct ipu_platform_reg *reg = &client_reg[i]; const struct ipu_platform_reg *reg = &client_reg[i];
struct platform_device *pdev; struct platform_device *pdev;
struct device_node *of_node;
/* Associate subdevice with the corresponding port node */
of_node = of_graph_get_port_by_id(dev->of_node, i);
if (!of_node) {
dev_info(dev,
"no port@%d node in %s, not using %s%d\n",
i, dev->of_node->full_name,
(i / 2) ? "DI" : "CSI", i % 2);
continue;
}
pdev = platform_device_alloc(reg->name, id++); pdev = platform_device_alloc(reg->name, id++);
if (!pdev) { if (!pdev) {
...@@ -1057,17 +1068,9 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base) ...@@ -1057,17 +1068,9 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
goto err_register; goto err_register;
} }
pdev->dev.of_node = of_node;
pdev->dev.parent = dev; pdev->dev.parent = dev;
/* Associate subdevice with the corresponding port node */
pdev->dev.of_node = of_graph_get_port_by_id(dev->of_node, i);
if (!pdev->dev.of_node) {
dev_err(dev, "missing port@%d node in %s\n", i,
dev->of_node->full_name);
ret = -ENODEV;
goto err_register;
}
ret = platform_device_add_data(pdev, &reg->pdata, ret = platform_device_add_data(pdev, &reg->pdata,
sizeof(reg->pdata)); sizeof(reg->pdata));
if (!ret) if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment