diff options
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index ccfbbab82a15..2f90ac6a7f79 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/irqflags.h> | 50 | #include <linux/irqflags.h> |
51 | #include <linux/rwsem.h> | 51 | #include <linux/rwsem.h> |
52 | #include <linux/pm_runtime.h> | 52 | #include <linux/pm_runtime.h> |
53 | #include <linux/pm_domain.h> | ||
53 | #include <linux/acpi.h> | 54 | #include <linux/acpi.h> |
54 | #include <linux/jump_label.h> | 55 | #include <linux/jump_label.h> |
55 | #include <asm/uaccess.h> | 56 | #include <asm/uaccess.h> |
@@ -643,10 +644,13 @@ static int i2c_device_probe(struct device *dev) | |||
643 | if (status < 0) | 644 | if (status < 0) |
644 | return status; | 645 | return status; |
645 | 646 | ||
646 | acpi_dev_pm_attach(&client->dev, true); | 647 | status = dev_pm_domain_attach(&client->dev, true); |
647 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); | 648 | if (status != -EPROBE_DEFER) { |
648 | if (status) | 649 | status = driver->probe(client, i2c_match_id(driver->id_table, |
649 | acpi_dev_pm_detach(&client->dev, true); | 650 | client)); |
651 | if (status) | ||
652 | dev_pm_domain_detach(&client->dev, true); | ||
653 | } | ||
650 | 654 | ||
651 | return status; | 655 | return status; |
652 | } | 656 | } |
@@ -666,7 +670,7 @@ static int i2c_device_remove(struct device *dev) | |||
666 | status = driver->remove(client); | 670 | status = driver->remove(client); |
667 | } | 671 | } |
668 | 672 | ||
669 | acpi_dev_pm_detach(&client->dev, true); | 673 | dev_pm_domain_detach(&client->dev, true); |
670 | return status; | 674 | return status; |
671 | } | 675 | } |
672 | 676 | ||