History

PM / Domains: Mark "name" const in dev_pm_domain_attach_by_name()

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.

Douglas Anderson committed 7 years ago

Commit eeb35df1 parent 7416f1f2 files · +3 −3Browse files

Unified · Split

2 files
  1. drivers/base/power/common.c +1 −1
  2. include/linux/pm_domain.h +2 −2
drivers/base/power/common.c+1−1
@@ -160,7 +160,7 @@ EXPORT_SYMBOL_GPL(dev_pm_domain_attach_by_id); · 159 unmodified lines
160 * For a detailed function description, see dev_pm_domain_attach_by_id().160 * For a detailed function description, see dev_pm_domain_attach_by_id().
161 */161 */
162struct device *dev_pm_domain_attach_by_name(struct device *dev,162struct device *dev_pm_domain_attach_by_name(struct device *dev,
163 char *name)163 const char *name)
164{164{
165 if (dev->pm_domain)165 if (dev->pm_domain)
166 return ERR_PTR(-EEXIST);166 return ERR_PTR(-EEXIST);
include/linux/pm_domain.h+2−2
@@ -341,7 +341,7 @@ int dev_pm_domain_attach(struct device *dev, bool power_on); · 340 unmodified lines
341struct device *dev_pm_domain_attach_by_id(struct device *dev,341struct device *dev_pm_domain_attach_by_id(struct device *dev,
342 unsigned int index);342 unsigned int index);
343struct device *dev_pm_domain_attach_by_name(struct device *dev,343struct device *dev_pm_domain_attach_by_name(struct device *dev,
344 char *name);344 const char *name);
345void dev_pm_domain_detach(struct device *dev, bool power_off);345void dev_pm_domain_detach(struct device *dev, bool power_off);
346void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);346void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd);
347#else347#else
@@ -355,7 +355,7 @@ static inline struct device *dev_pm_domain_attach_by_id(struct device *dev, · 7 unmodified lines
355 return NULL;355 return NULL;
356}356}
357static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,357static inline struct device *dev_pm_domain_attach_by_name(struct device *dev,
358 char *name)358 const char *name)
359{359{
360 return NULL;360 return NULL;
361}361}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t