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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -271,7 +271,7 @@ int genpd_dev_pm_attach(struct device *dev); · 270 unmodified lines | |||
| 271 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, | 271 | struct device *genpd_dev_pm_attach_by_id(struct device *dev, |
| 272 | unsigned int index); | 272 | unsigned int index); |
| 273 | struct device *genpd_dev_pm_attach_by_name(struct device *dev, | 273 | struct device *genpd_dev_pm_attach_by_name(struct device *dev, |
| 274 | char *name); | 274 | const char *name); |
| 275 | #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ | 275 | #else /* !CONFIG_PM_GENERIC_DOMAINS_OF */ |
| 276 | static inline int of_genpd_add_provider_simple(struct device_node *np, | 276 | static inline int of_genpd_add_provider_simple(struct device_node *np, |
| 277 | struct generic_pm_domain *genpd) | 277 | struct generic_pm_domain *genpd) |
| @@ -324,7 +324,7 @@ static inline struct device *genpd_dev_pm_attach_by_id(struct device *dev, · 46 unmodified lines | |||
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev, | 326 | static inline struct device *genpd_dev_pm_attach_by_name(struct device *dev, |
| 327 | char *name) | 327 | const char *name) |
| 328 | { | 328 | { |
| 329 | return NULL; | 329 | return NULL; |
| 330 | } | 330 | } |