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>,
linux-pm@vger.kernel.org
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Kevin Hilman <khilman@linaro.org>,
Tomasz Figa <tomasz.figa@gmail.com>,
Philipp Zabel <philipp.zabel@gmail.com>,
Russell King <linux@arm.linux.org.uk>,
Mark Brown <broonie@kernel.org>, Wolfram Sang <wsa@the-dreams.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH] PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h
Date: Mon, 29 Sep 2014 13:58:47 +0200 [thread overview]
Message-ID: <1411991927-19654-1-git-send-email-ulf.hansson@linaro.org> (raw)
The commit below, started using errno values in pm.h header file. It
also failed to include the header for these, thus it caused compiler
errors.
46420dd73b800f87a19af13af5883855cf38cb08
(PM / Domains: Add APIs to attach/detach a PM domain for a device)
Instead of including the errno header to pm.h, let's move the functions
to pm_domain.h, since it's a better match.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
drivers/amba/bus.c | 1 +
drivers/base/platform.c | 1 +
drivers/i2c/i2c-core.c | 1 +
drivers/mmc/core/sdio_bus.c | 1 +
drivers/spi/spi.c | 1 +
include/linux/pm.h | 11 -----------
include/linux/pm_domain.h | 11 +++++++++++
7 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 8f52393..47bbdc1 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -15,6 +15,7 @@
#include <linux/io.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/amba/bus.h>
#include <linux/sizes.h>
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 904be3d..b2afc29 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -21,6 +21,7 @@
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/idr.h>
#include <linux/acpi.h>
#include <linux/clk/clk-conf.h>
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 3cd8f11..e61a6c5 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -48,6 +48,7 @@
#include <linux/irqflags.h>
#include <linux/rwsem.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/acpi.h>
#include <linux/jump_label.h>
#include <asm/uaccess.h>
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 1df0fc6..65cf7a7 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -16,6 +16,7 @@
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/acpi.h>
#include <linux/mmc/card.h>
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 72a0beb..3907f14 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -35,6 +35,7 @@
#include <linux/spi/spi.h>
#include <linux/of_gpio.h>
#include <linux/pm_runtime.h>
+#include <linux/pm_domain.h>
#include <linux/export.h>
#include <linux/sched/rt.h>
#include <linux/delay.h>
diff --git a/include/linux/pm.h b/include/linux/pm.h
index c4cbf48..1022ba1 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -622,17 +622,6 @@ struct dev_pm_domain {
void (*detach)(struct device *dev, bool power_off);
};
-#ifdef CONFIG_PM
-extern int dev_pm_domain_attach(struct device *dev, bool power_on);
-extern void dev_pm_domain_detach(struct device *dev, bool power_off);
-#else
-static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
-{
- return -ENODEV;
-}
-static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {}
-#endif
-
/*
* The PM_EVENT_ messages are also used by drivers implementing the legacy
* suspend framework, based on the ->suspend() and ->resume() callbacks common
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index ed4f4a7..9004743 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -301,4 +301,15 @@ static inline int of_genpd_add_provider_onecell(struct device_node *np,
return __of_genpd_add_provider(np, __of_genpd_xlate_onecell, data);
}
+#ifdef CONFIG_PM
+extern int dev_pm_domain_attach(struct device *dev, bool power_on);
+extern void dev_pm_domain_detach(struct device *dev, bool power_off);
+#else
+static inline int dev_pm_domain_attach(struct device *dev, bool power_on)
+{
+ return -ENODEV;
+}
+static inline void dev_pm_domain_detach(struct device *dev, bool power_off) {}
+#endif
+
#endif /* _LINUX_PM_DOMAIN_H */
--
1.9.1
next reply other threads:[~2014-09-29 11:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 11:58 Ulf Hansson [this message]
2014-09-29 12:33 ` [PATCH] PM / Domains: Move dev_pm_domain_attach|detach() to pm_domain.h Geert Uytterhoeven
2014-09-29 12:54 ` Wolfram Sang
2014-09-29 16:57 ` Mark Brown
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=1411991927-19654-1-git-send-email-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--cc=broonie@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@linaro.org \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=pavel@ucw.cz \
--cc=philipp.zabel@gmail.com \
--cc=rjw@rjwysocki.net \
--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).