Merge tag 'devicetree-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh...
[sfrench/cifs-2.6.git] / drivers / media / platform / s5p-mfc / s5p_mfc.c
index 8a5ba3bec3af2f82d2e27fd8fe99495dbf0333a2..9a53d3908b527b2f4b439d1b48ad3d54ac632987 100644 (file)
@@ -1089,11 +1089,17 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
        device_initialize(child);
        dev_set_name(child, "%s:%s", dev_name(dev), name);
        child->parent = dev;
-       child->bus = dev->bus;
        child->coherent_dma_mask = dev->coherent_dma_mask;
        child->dma_mask = dev->dma_mask;
        child->release = s5p_mfc_memdev_release;
 
+       /*
+        * The memdevs are not proper OF platform devices, so in order for them
+        * to be treated as valid DMA masters we need a bit of a hack to force
+        * them to inherit the MFC node's DMA configuration.
+        */
+       of_dma_configure(child, dev->of_node, true);
+
        if (device_add(child) == 0) {
                ret = of_reserved_mem_device_init_by_idx(child, dev->of_node,
                                                         idx);