Message ID | 1426261429-31883-6-git-send-email-ulf.hansson@linaro.org |
---|---|
State | New |
Headers | show |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 210cf48..0eabe55 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -655,8 +655,15 @@ static int i2c_device_probe(struct device *dev) status = dev_pm_domain_attach(&client->dev, true); if (status != -EPROBE_DEFER) { + status = dev_pm_domain_get(client->dev.pm_domain); + if (status) { + dev_pm_domain_detach(&client->dev, true); + return status; + } + status = driver->probe(client, i2c_match_id(driver->id_table, client)); + dev_pm_domain_put(client->dev.pm_domain); if (status) dev_pm_domain_detach(&client->dev, true); }
To sucessfully probe some devices their corresponding PM domains may need to be powered. Use the dev_pm_domain_get|put() APIs, to control the behavior of the PM domain. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/i2c/i2c-core.c | 7 +++++++ 1 file changed, 7 insertions(+)