]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/base/platform.c
Merge branch 'release/qcomlt-4.4' into stable-4.4
[karo-tx-linux.git] / drivers / base / platform.c
index 176b59f5bc4717925e174ce18d794470cf58b91e..c385585b8e2037880c0163f54f599d9e1a28fea4 100644 (file)
@@ -512,6 +512,10 @@ static int platform_drv_probe(struct device *_dev)
        if (ret < 0)
                return ret;
 
+       ret = of_dma_configure_ops(_dev, _dev->of_node);
+       if (ret < 0)
+               goto done;
+
        ret = dev_pm_domain_attach(_dev, true);
        if (ret != -EPROBE_DEFER) {
                if (drv->probe) {
@@ -524,6 +528,10 @@ static int platform_drv_probe(struct device *_dev)
                }
        }
 
+       if (ret)
+               of_dma_deconfigure(_dev);
+
+done:
        if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
                dev_warn(_dev, "probe deferral not supported\n");
                ret = -ENXIO;
@@ -546,6 +554,7 @@ static int platform_drv_remove(struct device *_dev)
        if (drv->remove)
                ret = drv->remove(dev);
        dev_pm_domain_detach(_dev, true);
+       of_dma_deconfigure(_dev);
 
        return ret;
 }