PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()
authorDouglas Anderson <dianders@chromium.org>
Thu, 14 Feb 2019 18:12:49 +0000 (10:12 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 15 Feb 2019 10:36:38 +0000 (11:36 +0100)
As of the patch ("PM / Domains: Mark "name" const in
genpd_dev_pm_attach_by_name()") it's clear that the name in
dev_pm_domain_attach_by_name() can be const.  Mark it as so.  This
allows drivers to pass in a name that was declared "const" in a
driver.

Fixes: 27dceb81f445 ("PM / Domains: Introduce dev_pm_domain_attach_by_name()")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/common.c
include/linux/pm_domain.h

index b413951c6abc8c5be2d2df2bd580d09947e89f5a..22aedb28aad7dabe9408ae24e8025e1355d87ab8 100644 (file)
@@ -160,7 +160,7 @@ EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id);
  * For a detailed function description, see dev_pm_domain_attach_by_id().
  */
 struct device *dev_pm_domain_attach_by_name(struct device *dev,
-                                           char *name)
+                                           const char *name)
 {
        if (dev->pm_domain)
                return ERR_PTR(-EEXIST);
index 203be5082f3380d49220700460dce7bb611ef498..1ed5874bcee09afef28c505574bbd2d213abd785 100644 (file)
@@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on);
 struct device *dev_pm_domain_attach_by_id(struct device *dev,
                                          unsigned int index);
 struct device *dev_pm_domain_attach_by_name(struct device *dev,
-                                           char *name);
+                                           const char *name);
 void dev_pm_domain_detach(struct device *dev, bool power_off);
 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
 #else
@@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev,
        return NULL;
 }
 static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,
-                                                         char *name)
+                                                         const char *name)
 {
        return NULL;
 }