diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-09-19 14:27:39 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-22 09:57:40 -0400 |
commit | e09b0d4e9b03e08f47ad53e3c509db2cf8f1dc9c (patch) | |
tree | 334e5d5e0fbad7159fd503545d14bd183e393179 | |
parent | cb51841397e8e5714cf82a7f91053f6e1fb80d1f (diff) |
i2c: core: Convert to dev_pm_domain_attach|detach()
Previously only the ACPI PM domain was supported by the i2c bus.
Let's convert to the common attach/detach functions for PM domains,
which currently means we are extending the support to include the
generic PM domain as well.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/i2c/i2c-core.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 632057a44615..3cd8f11f1b5f 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -279,10 +279,13 @@ static int i2c_device_probe(struct device *dev) | |||
279 | if (status < 0) | 279 | if (status < 0) |
280 | return status; | 280 | return status; |
281 | 281 | ||
282 | acpi_dev_pm_attach(&client->dev, true); | 282 | status = dev_pm_domain_attach(&client->dev, true); |
283 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); | 283 | if (status != -EPROBE_DEFER) { |
284 | if (status) | 284 | status = driver->probe(client, i2c_match_id(driver->id_table, |
285 | acpi_dev_pm_detach(&client->dev, true); | 285 | client)); |
286 | if (status) | ||
287 | dev_pm_domain_detach(&client->dev, true); | ||
288 | } | ||
286 | 289 | ||
287 | return status; | 290 | return status; |
288 | } | 291 | } |
@@ -302,7 +305,7 @@ static int i2c_device_remove(struct device *dev) | |||
302 | status = driver->remove(client); | 305 | status = driver->remove(client); |
303 | } | 306 | } |
304 | 307 | ||
305 | acpi_dev_pm_detach(&client->dev, true); | 308 | dev_pm_domain_detach(&client->dev, true); |
306 | return status; | 309 | return status; |
307 | } | 310 | } |
308 | 311 | ||