]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/base/platform.c
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / base / platform.c
index ab4f4ce02722d0520e53f30baaeefd00ada8aea6..b2afc29403f9e887554d441a0c36629ccb49bce6 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
 #include <linux/idr.h>
 #include <linux/acpi.h>
 #include <linux/clk/clk-conf.h>
@@ -506,11 +507,12 @@ static int platform_drv_probe(struct device *_dev)
        if (ret < 0)
                return ret;
 
-       acpi_dev_pm_attach(_dev, true);
-
-       ret = drv->probe(dev);
-       if (ret)
-               acpi_dev_pm_detach(_dev, true);
+       ret = dev_pm_domain_attach(_dev, true);
+       if (ret != -EPROBE_DEFER) {
+               ret = drv->probe(dev);
+               if (ret)
+                       dev_pm_domain_detach(_dev, true);
+       }
 
        if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
                dev_warn(_dev, "probe deferral not supported\n");
@@ -532,7 +534,7 @@ static int platform_drv_remove(struct device *_dev)
        int ret;
 
        ret = drv->remove(dev);
-       acpi_dev_pm_detach(_dev, true);
+       dev_pm_domain_detach(_dev, true);
 
        return ret;
 }
@@ -543,7 +545,7 @@ static void platform_drv_shutdown(struct device *_dev)
        struct platform_device *dev = to_platform_device(_dev);
 
        drv->shutdown(dev);
-       acpi_dev_pm_detach(_dev, true);
+       dev_pm_domain_detach(_dev, true);
 }
 
 /**