From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach()
Date: Sat, 20 Sep 2014 14:23:19 +0200 [thread overview]
Message-ID: <20140920122318.GC3850@katana> (raw)
In-Reply-To: <1411151264-16245-7-git-send-email-ulf.hansson@linaro.org>
On Fri, Sep 19, 2014 at 08:27:39PM +0200, Ulf Hansson wrote:
> 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.
>
> Cc: linux-i2c at vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Kevin Hilman <khilman@linaro.org>
Looks good to me, but I'd like to give Mika a chance to look at it,
since he does ACPI with I2C. Adding to CC.
> ---
> drivers/i2c/i2c-core.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 632057a..3cd8f11 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)
> 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));
Very minor: I think it is more readable to keep this in one line.
> + if (status)
> + dev_pm_domain_detach(&client->dev, true);
> + }
>
> return status;
> }
> @@ -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;
> }
>
> --
> 1.9.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140920/d5eb39c5/attachment.sig>
next prev parent reply other threads:[~2014-09-20 12:23 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-19 18:27 [PATCH v5 00/11] PM / Domains: Generic OF-based support Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 01/11] PM / Domains: Add a detach callback to the struct dev_pm_domain Ulf Hansson
2014-09-22 11:15 ` Geert Uytterhoeven
2014-09-19 18:27 ` [PATCH v5 02/11] ACPI / PM: Assign the ->detach() callback when attaching the PM domain Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 03/11] PM / Domains: Add generic OF-based PM domain look-up Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 04/11] PM / Domains: Add APIs to attach/detach a PM domain for a device Ulf Hansson
2014-09-22 11:12 ` Geert Uytterhoeven
2014-09-19 18:27 ` [PATCH v5 05/11] drivercore / platform: Convert to dev_pm_domain_attach|detach() Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 06/11] i2c: core: " Ulf Hansson
2014-09-20 12:23 ` Wolfram Sang [this message]
2014-09-20 23:48 ` Rafael J. Wysocki
2014-09-22 9:52 ` Mika Westerberg
2014-09-22 10:00 ` Wolfram Sang
2014-09-19 18:27 ` [PATCH v5 07/11] mmc: sdio: " Ulf Hansson
2014-10-02 0:27 ` Dmitry Torokhov
2014-10-13 2:48 ` Aaron Lu
2014-10-13 11:44 ` Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 08/11] spi: core: " Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 09/11] amba: Add support for attach/detach of PM domains Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 10/11] ARM: exynos: Move to generic PM domain DT bindings Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 11/11] ACPI / PM: Convert acpi_dev_pm_detach() into a static function Ulf Hansson
2014-09-19 18:48 ` [PATCH v5 00/11] PM / Domains: Generic OF-based support Dmitry Torokhov
2014-09-22 14:19 ` Rafael J. Wysocki
2014-09-22 19:04 ` Ulf Hansson
2014-09-23 1:42 ` Mark Brown
2014-09-24 12:44 ` Grygorii Strashko
2014-09-24 13:51 ` Rafael J. Wysocki
2014-09-24 13:59 ` Grygorii Strashko
2014-09-25 11:21 ` Thierry Reding
2014-09-25 15:29 ` Ulf Hansson
2014-09-25 16:56 ` Thierry Reding
2014-09-26 0:27 ` Stephen Boyd
2014-09-26 5:08 ` Kevin Hilman
2014-09-26 7:44 ` Thierry Reding
2014-09-25 22:45 ` Kevin Hilman
2014-09-26 7:31 ` Thierry Reding
2014-09-26 8:06 ` Geert Uytterhoeven
2014-09-26 9:56 ` Thierry Reding
2014-09-26 10:01 ` Geert Uytterhoeven
2014-09-26 10:04 ` Thierry Reding
2014-09-26 14:50 ` Kevin Hilman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140920122318.GC3850@katana \
--to=wsa@the-dreams.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).