aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-06 19:18:12 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-10-06 19:18:12 -0400
commit49a09c9ab012017c4673b86dbb28c616cf8f2381 (patch)
tree9cdc84a6b837268060bfad89d5bd43032dc0fd74 /drivers/i2c
parent28c399e2a1ed03bd175858deef1e233317103089 (diff)
parentf39cb1797ec1094b196d3dab44a7ca6060813d38 (diff)
Merge branch 'pm-domains'
* pm-domains: (32 commits) PM / Domains: Rename cpu_data to cpuidle_data PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h PM / Domains: Remove legacy API for adding devices through DT PM / Domains: Add genpd attach/detach callbacks PM / Domains: add debugfs listing of struct generic_pm_domain-s ACPI / PM: Convert acpi_dev_pm_detach() into a static function ARM: exynos: Move to generic PM domain DT bindings amba: Add support for attach/detach of PM domains spi: core: Convert to dev_pm_domain_attach|detach() mmc: sdio: Convert to dev_pm_domain_attach|detach() i2c: core: Convert to dev_pm_domain_attach|detach() drivercore / platform: Convert to dev_pm_domain_attach|detach() PM / Domains: Add APIs to attach/detach a PM domain for a device PM / Domains: Add generic OF-based PM domain look-up ACPI / PM: Assign the ->detach() callback when attaching the PM domain PM / Domains: Add a detach callback to the struct dev_pm_domain PM / domains: Spelling s/domian/domain/ PM / domains: Keep declaration of dev_power_governors together PM / domains: Remove default_stop_ok() API drivers: sh: Leave disabling of unused PM domains to genpd ...
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c14
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