Skip to contentSkip to conversation

usb: chipidea: Set the DT node on the child device

PATCH In review Rob Herring 2 participants 2 messages Dec 15, 2021 – Dec 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: chipidea: Set the DT node on the child device

The ChipIdea glue drivers just copy the glue resources to the "ci_hdrc" child device. Instead, set the child device's DT node pointer to the parent device's node so that platform_get_irq() can find the IRQ resources in the DT. This removes the need for statically populating the IRQ resources from the DT which has been deprecated for some time.

---
 drivers/usb/chipidea/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/chipidea/core.c +1 -0
index a56f06368d14..5359b2a2e4d2 100644
@@ -864,6 +864,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
 	}
 
 	pdev->dev.parent = dev;
+	device_set_of_node_from_dev(&pdev->dev, dev);
 
 	ret = platform_device_add_resources(pdev, res, nres);
 	if (ret)
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Rob Herring

The ChipIdea glue drivers just copy the glue resources to the "ci_hdrc" child device. Instead, set the child device's DT node pointer to the parent device's node so that platform_get_irq() can find the IRQ resources in the DT. This removes the need for statically populating the IRQ resources from the DT which has been deprecated for some time.

Quoted 19 lines
---
 drivers/usb/chipidea/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/chipidea/core.c +1 -0
index a56f06368d14..5359b2a2e4d2 100644
@@ -864,6 +864,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
 	}
 
 	pdev->dev.parent = dev;
+	device_set_of_node_from_dev(&pdev->dev, dev);
 
 	ret = platform_device_add_resources(pdev, res, nres);
 	if (ret)
Signature · 1 line
2.32.0
Signature · 2 lines
Thanks,
Peter Chen