From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Geert Uytterhoeven
<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Alan Stern
<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
Daniel Lezcano
<daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Tomasz Figa <tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Philipp Zabel
<philipp.zabel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Chris Ball <chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org>,
Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Dmitry Torokhov <dmitry.torokhov@gmail>
Subject: Re: [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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Reviewed-by: Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
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
[not found] ` <1411151264-16245-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-19 18:27 ` [PATCH v5 06/11] i2c: core: " Ulf Hansson
[not found] ` <1411151264-16245-7-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
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 10/11] ARM: exynos: Move to generic PM domain DT bindings Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 08/11] spi: core: Convert to dev_pm_domain_attach|detach() 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 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-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=chris-OsFVWbfNK3isTnJN9+BGXg@public.gmane.org \
--cc=daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dmitry.torokhov@gmail \
--cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
--cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@public.gmane.org \
--cc=philipp.zabel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
--cc=tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).