linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name()
@ 2019-02-14 18:12 Douglas Anderson
  2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Douglas Anderson @ 2019-02-14 18:12 UTC (permalink / raw)
  To: Rafael J . Wysocki, Ulf Hansson
  Cc: linux-arm-msm, Viresh Kumar, Rajendra Nayak, swboyd,
	Douglas Anderson, linux-pm, linux-kernel, Len Brown,
	Kevin Hilman, Greg Kroah-Hartman, Pavel Machek

The genpd_dev_pm_attach_by_name() simply takes the name and passes it
to of_property_match_string() where the argument is "const char *".
Adding a const here allows a later patch to add a const to
dev_pm_domain_attach_by_name() which allows drivers to pass in a name
that was declared "const" in a driver.

Fixes: 5d6be70add65 ("PM / Domains: Introduce option to attach a device by name to genpd")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/base/power/domain.c | 2 +-
 include/linux/pm_domain.h   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 45eafe8cf7dd..2c334c01fc43 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2483,7 +2483,7 @@ EXPORT_SYMBOL_GPL(genpd_dev_pm_attach_by_id);
  * power-domain-names DT property. For further description see
  * genpd_dev_pm_attach_by_id().
  */
-struct device *genpd_dev_pm_attach_by_name(struct device *dev, char *name)
+struct device *genpd_dev_pm_attach_by_name(struct device *dev, const char *name)
 {
 	int index;
 
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index dd364abb649a..203be5082f33 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev);
 struct device *genpd_dev_pm_attach_by_id(struct device *dev,
 					 unsigned int index);
 struct device *genpd_dev_pm_attach_by_name(struct device *dev,
-					   char *name);
+					   const char *name);
 #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */
 static inline int of_genpd_add_provider_simple(struct device_node *np,
 					struct generic_pm_domain *genpd)
@@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev,
 }
 
 static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev,
-							 char *name)
+							 const char *name)
 {
 	return NULL;
 }
-- 
2.21.0.rc0.258.g878e2cd30e-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-02-19 10:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 18:12 [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Douglas Anderson
2019-02-14 18:12 ` [PATCH 2/2] PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name() Douglas Anderson
2019-02-14 18:23   ` Stephen Boyd
2019-02-15 10:27   ` Ulf Hansson
2019-02-15 15:42     ` Doug Anderson
2019-02-14 18:23 ` [PATCH 1/2] PM / Domains: Mark "name" const in genpd_dev_pm_attach_by_name() Stephen Boyd
2019-02-15  3:02 ` Viresh Kumar
2019-02-15 15:47   ` Doug Anderson
2019-02-18  4:15     ` Viresh Kumar
2019-02-18  8:41       ` Greg Kroah-Hartman
2019-02-15 10:27 ` Ulf Hansson
2019-02-19 10:19 ` Rafael J. Wysocki

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).