From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Kevin Hilman <khilman@linaro.org>,
Alan Stern <stern@rowland.harvard.edu>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Tomasz Figa <tomasz.figa@gmail.com>,
devicetree@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
Ben Dooks <ben-linux@fluff.org>,
Kukjin Kim <kgene.kim@samsung.com>,
Stephen Boyd <sboyd@codeaurora.org>,
Philipp Zabel <philipp.zabel@gmail.com>,
Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>,
Chris Ball <chris@printf.net>,
Russell King <linux@arm.linux.org.uk>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-spi@vger.kernel.org
Subject: [PATCH v2 7/9] spi: core: Convert to dev_pm_domain_attach|detach()
Date: Thu, 28 Aug 2014 10:39:00 +0200 [thread overview]
Message-ID: <1409215142-8218-8-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1409215142-8218-1-git-send-email-ulf.hansson@linaro.org>
Previously only the ACPI power domain was supported by the spi bus.
Let's convert to the common attach/detach functions for power domains,
which currently means we are extending the support to include the
generic power domain as well.
Cc: linux-spi@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/spi/spi.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index e0531ba..6a7b0cc 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -264,10 +264,12 @@ static int spi_drv_probe(struct device *dev)
if (ret)
return ret;
- acpi_dev_pm_attach(dev, true);
- ret = sdrv->probe(to_spi_device(dev));
- if (ret)
- acpi_dev_pm_detach(dev, true);
+ ret = dev_pm_domain_attach(dev, true);
+ if (ret != -EPROBE_DEFER) {
+ ret = sdrv->probe(to_spi_device(dev));
+ if (ret)
+ dev_pm_domain_detach(dev, true);
+ }
return ret;
}
@@ -278,7 +280,7 @@ static int spi_drv_remove(struct device *dev)
int ret;
ret = sdrv->remove(to_spi_device(dev));
- acpi_dev_pm_detach(dev, true);
+ dev_pm_domain_detach(dev, true);
return ret;
}
--
1.9.1
parent reply other threads:[~2014-08-28 8:39 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1409215142-8218-1-git-send-email-ulf.hansson@linaro.org>]
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=1409215142-8218-8-git-send-email-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--cc=ben-linux@fluff.org \
--cc=broonie@kernel.org \
--cc=chris@printf.net \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=horms@verge.net.au \
--cc=kgene.kim@samsung.com \
--cc=khilman@linaro.org \
--cc=len.brown@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=pavel@ucw.cz \
--cc=philipp.zabel@gmail.com \
--cc=rjw@rjwysocki.net \
--cc=sboyd@codeaurora.org \
--cc=stern@rowland.harvard.edu \
--cc=tomasz.figa@gmail.com \
--cc=wsa@the-dreams.de \
/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).