staging: vchiq_arm: children inherit DMA config
authorPhil Elwell <phil@raspberrypi.com>
Tue, 21 Jul 2020 16:34:09 +0000 (17:34 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:11 +0000 (11:33 +0000)
Although it is no longer necessary for vchiq's children to have a
different DMA configuration to the parent, they do still need to
explicitly to have their DMA configuration set - to be that of the
parent.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c

index 52ca088..48f28ea 100644 (file)
@@ -1869,8 +1869,18 @@ vchiq_register_child(struct platform_device *pdev, const char *name)
 
        child->dev.of_node = np;
 
+       /*
+        * We want the dma-ranges etc to be copied from the parent VCHIQ device
+        * to be passed on to the children without a node of their own.
+        */
+       if (!np)
+               np = pdev->dev.of_node;
+
        of_dma_configure(&child->dev, np, true);
 
+       if (np != pdev->dev.of_node)
+               of_node_put(np);
+
        return child;
 }