Skip to content

Commit cf081d0

Browse files
robherringgregkh
authored andcommitted
usb: musb: Set the DT node on the child device
The musb glue drivers just copy the glue resources to the musb child device. Instead, set the musb child device's DT node pointer to the parent device's node so that platform_get_irq_byname() can find the resources in the DT. This removes the need for statically populating the IRQ resources from the DT which has been deprecated for some time. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20211215230756.2009115-3-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9879c81 commit cf081d0

File tree

6 files changed

+9
-0
lines changed

6 files changed

+9
-0
lines changed

drivers/usb/musb/am35x.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ static int am35x_probe(struct platform_device *pdev)
500500
pinfo.num_res = pdev->num_resources;
501501
pinfo.data = pdata;
502502
pinfo.size_data = sizeof(*pdata);
503+
pinfo.fwnode = of_fwnode_handle(pdev->dev.of_node);
504+
pinfo.of_node_reused = true;
503505

504506
glue->musb = musb = platform_device_register_full(&pinfo);
505507
if (IS_ERR(musb)) {

drivers/usb/musb/da8xx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,8 @@ static int da8xx_probe(struct platform_device *pdev)
563563
pinfo.num_res = pdev->num_resources;
564564
pinfo.data = pdata;
565565
pinfo.size_data = sizeof(*pdata);
566+
pinfo.fwnode = of_fwnode_handle(np);
567+
pinfo.of_node_reused = true;
566568

567569
glue->musb = platform_device_register_full(&pinfo);
568570
ret = PTR_ERR_OR_ZERO(glue->musb);

drivers/usb/musb/jz4740.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static int jz4740_probe(struct platform_device *pdev)
231231
musb->dev.parent = dev;
232232
musb->dev.dma_mask = &musb->dev.coherent_dma_mask;
233233
musb->dev.coherent_dma_mask = DMA_BIT_MASK(32);
234+
device_set_of_node_from_dev(&musb->dev, dev);
234235

235236
glue->pdev = musb;
236237
glue->clk = clk;

drivers/usb/musb/mediatek.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ static int mtk_musb_probe(struct platform_device *pdev)
538538
pinfo.num_res = pdev->num_resources;
539539
pinfo.data = pdata;
540540
pinfo.size_data = sizeof(*pdata);
541+
pinfo.fwnode = of_fwnode_handle(np);
542+
pinfo.of_node_reused = true;
541543

542544
glue->musb_pdev = platform_device_register_full(&pinfo);
543545
if (IS_ERR(glue->musb_pdev)) {

drivers/usb/musb/omap2430.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ static int omap2430_probe(struct platform_device *pdev)
327327
musb->dev.parent = &pdev->dev;
328328
musb->dev.dma_mask = &omap2430_dmamask;
329329
musb->dev.coherent_dma_mask = omap2430_dmamask;
330+
device_set_of_node_from_dev(&musb->dev, &pdev->dev);
330331

331332
glue->dev = &pdev->dev;
332333
glue->musb = musb;

drivers/usb/musb/ux500.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ static int ux500_probe(struct platform_device *pdev)
262262
musb->dev.parent = &pdev->dev;
263263
musb->dev.dma_mask = &pdev->dev.coherent_dma_mask;
264264
musb->dev.coherent_dma_mask = pdev->dev.coherent_dma_mask;
265+
device_set_of_node_from_dev(&musb->dev, &pdev->dev);
265266

266267
glue->dev = &pdev->dev;
267268
glue->musb = musb;

0 commit comments

Comments
 (0)