Skip to content

Commit

Permalink
i2c: core: Convert to dev_pm_domain_attach|detach()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ulf Hansson authored and Rafael J. Wysocki committed Sep 22, 2014
1 parent cb51841 commit e09b0d4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,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;
}
Expand All @@ -302,7 +305,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;
}

Expand Down

0 comments on commit e09b0d4

Please sign in to comment.