]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/i2c/i2c-core.c
Merge branch 'pm-domains'
[karo-tx-linux.git] / drivers / i2c / i2c-core.c
index ccfbbab82a157da532fb039f7032d0de38680d0f..2f90ac6a7f794ad8e79577a2c5e59ed853bf413f 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/irqflags.h>
 #include <linux/rwsem.h>
 #include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
 #include <linux/acpi.h>
 #include <linux/jump_label.h>
 #include <asm/uaccess.h>
@@ -643,10 +644,13 @@ static int i2c_device_probe(struct device *dev)
        if (status < 0)
                return status;
 
-       acpi_dev_pm_attach(&client->dev, true);
-       status = driver->probe(client, i2c_match_id(driver->id_table, client));
-       if (status)
-               acpi_dev_pm_detach(&client->dev, true);
+       status = dev_pm_domain_attach(&client->dev, true);
+       if (status != -EPROBE_DEFER) {
+               status = driver->probe(client, i2c_match_id(driver->id_table,
+                                       client));
+               if (status)
+                       dev_pm_domain_detach(&client->dev, true);
+       }
 
        return status;
 }
@@ -666,7 +670,7 @@ static int i2c_device_remove(struct device *dev)
                status = driver->remove(client);
        }
 
-       acpi_dev_pm_detach(&client->dev, true);
+       dev_pm_domain_detach(&client->dev, true);
        return status;
 }