Commit cf081d00 authored by Rob Herring's avatar Rob Herring Committed by Greg Kroah-Hartman
Browse files

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: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211215230756.2009115-3-robh@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9879c81b
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -500,6 +500,8 @@ static int am35x_probe(struct platform_device *pdev)
	pinfo.num_res = pdev->num_resources;
	pinfo.num_res = pdev->num_resources;
	pinfo.data = pdata;
	pinfo.data = pdata;
	pinfo.size_data = sizeof(*pdata);
	pinfo.size_data = sizeof(*pdata);
	pinfo.fwnode = of_fwnode_handle(pdev->dev.of_node);
	pinfo.of_node_reused = true;


	glue->musb = musb = platform_device_register_full(&pinfo);
	glue->musb = musb = platform_device_register_full(&pinfo);
	if (IS_ERR(musb)) {
	if (IS_ERR(musb)) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -563,6 +563,8 @@ static int da8xx_probe(struct platform_device *pdev)
	pinfo.num_res = pdev->num_resources;
	pinfo.num_res = pdev->num_resources;
	pinfo.data = pdata;
	pinfo.data = pdata;
	pinfo.size_data = sizeof(*pdata);
	pinfo.size_data = sizeof(*pdata);
	pinfo.fwnode = of_fwnode_handle(np);
	pinfo.of_node_reused = true;


	glue->musb = platform_device_register_full(&pinfo);
	glue->musb = platform_device_register_full(&pinfo);
	ret = PTR_ERR_OR_ZERO(glue->musb);
	ret = PTR_ERR_OR_ZERO(glue->musb);
+1 −0
Original line number Original line Diff line number Diff line
@@ -231,6 +231,7 @@ static int jz4740_probe(struct platform_device *pdev)
	musb->dev.parent		= dev;
	musb->dev.parent		= dev;
	musb->dev.dma_mask		= &musb->dev.coherent_dma_mask;
	musb->dev.dma_mask		= &musb->dev.coherent_dma_mask;
	musb->dev.coherent_dma_mask	= DMA_BIT_MASK(32);
	musb->dev.coherent_dma_mask	= DMA_BIT_MASK(32);
	device_set_of_node_from_dev(&musb->dev, dev);


	glue->pdev			= musb;
	glue->pdev			= musb;
	glue->clk			= clk;
	glue->clk			= clk;
+2 −0
Original line number Original line Diff line number Diff line
@@ -538,6 +538,8 @@ static int mtk_musb_probe(struct platform_device *pdev)
	pinfo.num_res = pdev->num_resources;
	pinfo.num_res = pdev->num_resources;
	pinfo.data = pdata;
	pinfo.data = pdata;
	pinfo.size_data = sizeof(*pdata);
	pinfo.size_data = sizeof(*pdata);
	pinfo.fwnode = of_fwnode_handle(np);
	pinfo.of_node_reused = true;


	glue->musb_pdev = platform_device_register_full(&pinfo);
	glue->musb_pdev = platform_device_register_full(&pinfo);
	if (IS_ERR(glue->musb_pdev)) {
	if (IS_ERR(glue->musb_pdev)) {
+1 −0
Original line number Original line Diff line number Diff line
@@ -327,6 +327,7 @@ static int omap2430_probe(struct platform_device *pdev)
	musb->dev.parent		= &pdev->dev;
	musb->dev.parent		= &pdev->dev;
	musb->dev.dma_mask		= &omap2430_dmamask;
	musb->dev.dma_mask		= &omap2430_dmamask;
	musb->dev.coherent_dma_mask	= omap2430_dmamask;
	musb->dev.coherent_dma_mask	= omap2430_dmamask;
	device_set_of_node_from_dev(&musb->dev, &pdev->dev);


	glue->dev			= &pdev->dev;
	glue->dev			= &pdev->dev;
	glue->musb			= musb;
	glue->musb			= musb;
Loading