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 ...
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user