diff options
| author | Ulf Hansson <ulf.hansson@linaro.org> | 2015-09-10 10:00:50 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-09-25 20:02:27 -0400 |
| commit | c6f7b48e7e21989f4cfc996837d55c595d5dbf87 (patch) | |
| tree | 3b662fd799a29dbd84aef8e2932e5ad43e356a41 | |
| parent | 1f93e4a96c9109378204c147b3eec0d0e8100fde (diff) | |
PM / Domains: Remove name based API for genpd
As all users of the named based APIs now have converted to the non-named
based APIs, the time has come to remove them.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | drivers/base/power/domain.c | 90 | ||||
| -rw-r--r-- | include/linux/pm_domain.h | 38 |
2 files changed, 0 insertions, 128 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 16550c63d611..a46427e72034 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c | |||
| @@ -53,24 +53,6 @@ | |||
| 53 | static LIST_HEAD(gpd_list); | 53 | static LIST_HEAD(gpd_list); |
| 54 | static DEFINE_MUTEX(gpd_list_lock); | 54 | static DEFINE_MUTEX(gpd_list_lock); |
| 55 | 55 | ||
| 56 | static struct generic_pm_domain *pm_genpd_lookup_name(const char *domain_name) | ||
| 57 | { | ||
| 58 | struct generic_pm_domain *genpd = NULL, *gpd; | ||
| 59 | |||
| 60 | if (IS_ERR_OR_NULL(domain_name)) | ||
| 61 | return NULL; | ||
| 62 | |||
| 63 | mutex_lock(&gpd_list_lock); | ||
| 64 | list_for_each_entry(gpd, &gpd_list, gpd_list_node) { | ||
| 65 | if (!strcmp(gpd->name, domain_name)) { | ||
| 66 | genpd = gpd; | ||
| 67 | break; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | mutex_unlock(&gpd_list_lock); | ||
| 71 | return genpd; | ||
| 72 | } | ||
| 73 | |||
| 74 | /* | 56 | /* |
| 75 | * Get the generic PM domain for a particular struct device. | 57 | * Get the generic PM domain for a particular struct device. |
| 76 | * This validates the struct device pointer, the PM domain pointer, | 58 | * This validates the struct device pointer, the PM domain pointer, |
| @@ -295,18 +277,6 @@ int pm_genpd_poweron(struct generic_pm_domain *genpd) | |||
| 295 | return ret; | 277 | return ret; |
| 296 | } | 278 | } |
| 297 | 279 | ||
| 298 | /** | ||
| 299 | * pm_genpd_name_poweron - Restore power to a given PM domain and its masters. | ||
| 300 | * @domain_name: Name of the PM domain to power up. | ||
| 301 | */ | ||
| 302 | int pm_genpd_name_poweron(const char *domain_name) | ||
| 303 | { | ||
| 304 | struct generic_pm_domain *genpd; | ||
| 305 | |||
| 306 | genpd = pm_genpd_lookup_name(domain_name); | ||
| 307 | return genpd ? pm_genpd_poweron(genpd) : -EINVAL; | ||
| 308 | } | ||
| 309 | |||
| 310 | static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev) | 280 | static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev) |
| 311 | { | 281 | { |
| 312 | return GENPD_DEV_TIMED_CALLBACK(genpd, int, save_state, dev, | 282 | return GENPD_DEV_TIMED_CALLBACK(genpd, int, save_state, dev, |
| @@ -1317,18 +1287,6 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, | |||
| 1317 | } | 1287 | } |
| 1318 | 1288 | ||
| 1319 | /** | 1289 | /** |
| 1320 | * __pm_genpd_name_add_device - Find I/O PM domain and add a device to it. | ||
| 1321 | * @domain_name: Name of the PM domain to add the device to. | ||
| 1322 | * @dev: Device to be added. | ||
| 1323 | * @td: Set of PM QoS timing parameters to attach to the device. | ||
| 1324 | */ | ||
| 1325 | int __pm_genpd_name_add_device(const char *domain_name, struct device *dev, | ||
| 1326 | struct gpd_timing_data *td) | ||
| 1327 | { | ||
| 1328 | return __pm_genpd_add_device(pm_genpd_lookup_name(domain_name), dev, td); | ||
| 1329 | } | ||
| 1330 | |||
| 1331 | /** | ||
| 1332 | * pm_genpd_remove_device - Remove a device from an I/O PM domain. | 1290 | * pm_genpd_remove_device - Remove a device from an I/O PM domain. |
| 1333 | * @genpd: PM domain to remove the device from. | 1291 | * @genpd: PM domain to remove the device from. |
| 1334 | * @dev: Device to be removed. | 1292 | * @dev: Device to be removed. |
| @@ -1429,35 +1387,6 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | |||
| 1429 | } | 1387 | } |
| 1430 | 1388 | ||
| 1431 | /** | 1389 | /** |
| 1432 | * pm_genpd_add_subdomain_names - Add a subdomain to an I/O PM domain. | ||
| 1433 | * @master_name: Name of the master PM domain to add the subdomain to. | ||
| 1434 | * @subdomain_name: Name of the subdomain to be added. | ||
| 1435 | */ | ||
| 1436 | int pm_genpd_add_subdomain_names(const char *master_name, | ||
| 1437 | const char *subdomain_name) | ||
| 1438 | { | ||
| 1439 | struct generic_pm_domain *master = NULL, *subdomain = NULL, *gpd; | ||
| 1440 | |||
| 1441 | if (IS_ERR_OR_NULL(master_name) || IS_ERR_OR_NULL(subdomain_name)) | ||
| 1442 | return -EINVAL; | ||
| 1443 | |||
| 1444 | mutex_lock(&gpd_list_lock); | ||
| 1445 | list_for_each_entry(gpd, &gpd_list, gpd_list_node) { | ||
| 1446 | if (!master && !strcmp(gpd->name, master_name)) | ||
| 1447 | master = gpd; | ||
| 1448 | |||
| 1449 | if (!subdomain && !strcmp(gpd->name, subdomain_name)) | ||
| 1450 | subdomain = gpd; | ||
| 1451 | |||
| 1452 | if (master && subdomain) | ||
| 1453 | break; | ||
| 1454 | } | ||
| 1455 | mutex_unlock(&gpd_list_lock); | ||
| 1456 | |||
| 1457 | return pm_genpd_add_subdomain(master, subdomain); | ||
| 1458 | } | ||
| 1459 | |||
| 1460 | /** | ||
| 1461 | * pm_genpd_remove_subdomain - Remove a subdomain from an I/O PM domain. | 1390 | * pm_genpd_remove_subdomain - Remove a subdomain from an I/O PM domain. |
| 1462 | * @genpd: Master PM domain to remove the subdomain from. | 1391 | * @genpd: Master PM domain to remove the subdomain from. |
| 1463 | * @subdomain: Subdomain to be removed. | 1392 | * @subdomain: Subdomain to be removed. |
| @@ -1566,16 +1495,6 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) | |||
| 1566 | } | 1495 | } |
| 1567 | 1496 | ||
| 1568 | /** | 1497 | /** |
| 1569 | * pm_genpd_name_attach_cpuidle - Find PM domain and connect cpuidle to it. | ||
| 1570 | * @name: Name of the domain to connect to cpuidle. | ||
| 1571 | * @state: cpuidle state this domain can manipulate. | ||
| 1572 | */ | ||
| 1573 | int pm_genpd_name_attach_cpuidle(const char *name, int state) | ||
| 1574 | { | ||
| 1575 | return pm_genpd_attach_cpuidle(pm_genpd_lookup_name(name), state); | ||
| 1576 | } | ||
| 1577 | |||
| 1578 | /** | ||
| 1579 | * pm_genpd_detach_cpuidle - Remove the cpuidle connection from a PM domain. | 1498 | * pm_genpd_detach_cpuidle - Remove the cpuidle connection from a PM domain. |
| 1580 | * @genpd: PM domain to remove the cpuidle connection from. | 1499 | * @genpd: PM domain to remove the cpuidle connection from. |
| 1581 | * | 1500 | * |
| @@ -1613,15 +1532,6 @@ int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) | |||
| 1613 | return ret; | 1532 | return ret; |
| 1614 | } | 1533 | } |
| 1615 | 1534 | ||
| 1616 | /** | ||
| 1617 | * pm_genpd_name_detach_cpuidle - Find PM domain and disconnect cpuidle from it. | ||
| 1618 | * @name: Name of the domain to disconnect cpuidle from. | ||
| 1619 | */ | ||
| 1620 | int pm_genpd_name_detach_cpuidle(const char *name) | ||
| 1621 | { | ||
| 1622 | return pm_genpd_detach_cpuidle(pm_genpd_lookup_name(name)); | ||
| 1623 | } | ||
| 1624 | |||
| 1625 | /* Default device callbacks for generic PM domains. */ | 1535 | /* Default device callbacks for generic PM domains. */ |
| 1626 | 1536 | ||
| 1627 | /** | 1537 | /** |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index b1cf7e797892..443fc196dc01 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
| @@ -125,27 +125,18 @@ extern int __pm_genpd_add_device(struct generic_pm_domain *genpd, | |||
| 125 | struct device *dev, | 125 | struct device *dev, |
| 126 | struct gpd_timing_data *td); | 126 | struct gpd_timing_data *td); |
| 127 | 127 | ||
| 128 | extern int __pm_genpd_name_add_device(const char *domain_name, | ||
| 129 | struct device *dev, | ||
| 130 | struct gpd_timing_data *td); | ||
| 131 | |||
| 132 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 128 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
| 133 | struct device *dev); | 129 | struct device *dev); |
| 134 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 130 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
| 135 | struct generic_pm_domain *new_subdomain); | 131 | struct generic_pm_domain *new_subdomain); |
| 136 | extern int pm_genpd_add_subdomain_names(const char *master_name, | ||
| 137 | const char *subdomain_name); | ||
| 138 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 132 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
| 139 | struct generic_pm_domain *target); | 133 | struct generic_pm_domain *target); |
| 140 | extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); | 134 | extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); |
| 141 | extern int pm_genpd_name_attach_cpuidle(const char *name, int state); | ||
| 142 | extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd); | 135 | extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd); |
| 143 | extern int pm_genpd_name_detach_cpuidle(const char *name); | ||
| 144 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 136 | extern void pm_genpd_init(struct generic_pm_domain *genpd, |
| 145 | struct dev_power_governor *gov, bool is_off); | 137 | struct dev_power_governor *gov, bool is_off); |
| 146 | 138 | ||
| 147 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | 139 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); |
| 148 | extern int pm_genpd_name_poweron(const char *domain_name); | ||
| 149 | extern void pm_genpd_poweroff_unused(void); | 140 | extern void pm_genpd_poweroff_unused(void); |
| 150 | 141 | ||
| 151 | extern struct dev_power_governor simple_qos_governor; | 142 | extern struct dev_power_governor simple_qos_governor; |
| @@ -166,12 +157,6 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd, | |||
| 166 | { | 157 | { |
| 167 | return -ENOSYS; | 158 | return -ENOSYS; |
| 168 | } | 159 | } |
| 169 | static inline int __pm_genpd_name_add_device(const char *domain_name, | ||
| 170 | struct device *dev, | ||
| 171 | struct gpd_timing_data *td) | ||
| 172 | { | ||
| 173 | return -ENOSYS; | ||
| 174 | } | ||
| 175 | static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 160 | static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
| 176 | struct device *dev) | 161 | struct device *dev) |
| 177 | { | 162 | { |
| @@ -182,11 +167,6 @@ static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | |||
| 182 | { | 167 | { |
| 183 | return -ENOSYS; | 168 | return -ENOSYS; |
| 184 | } | 169 | } |
| 185 | static inline int pm_genpd_add_subdomain_names(const char *master_name, | ||
| 186 | const char *subdomain_name) | ||
| 187 | { | ||
| 188 | return -ENOSYS; | ||
| 189 | } | ||
| 190 | static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 170 | static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
| 191 | struct generic_pm_domain *target) | 171 | struct generic_pm_domain *target) |
| 192 | { | 172 | { |
| @@ -196,18 +176,10 @@ static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int s | |||
| 196 | { | 176 | { |
| 197 | return -ENOSYS; | 177 | return -ENOSYS; |
| 198 | } | 178 | } |
| 199 | static inline int pm_genpd_name_attach_cpuidle(const char *name, int state) | ||
| 200 | { | ||
| 201 | return -ENOSYS; | ||
| 202 | } | ||
| 203 | static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) | 179 | static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) |
| 204 | { | 180 | { |
| 205 | return -ENOSYS; | 181 | return -ENOSYS; |
| 206 | } | 182 | } |
| 207 | static inline int pm_genpd_name_detach_cpuidle(const char *name) | ||
| 208 | { | ||
| 209 | return -ENOSYS; | ||
| 210 | } | ||
| 211 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, | 183 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, |
| 212 | struct dev_power_governor *gov, bool is_off) | 184 | struct dev_power_governor *gov, bool is_off) |
| 213 | { | 185 | { |
| @@ -216,10 +188,6 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd) | |||
| 216 | { | 188 | { |
| 217 | return -ENOSYS; | 189 | return -ENOSYS; |
| 218 | } | 190 | } |
| 219 | static inline int pm_genpd_name_poweron(const char *domain_name) | ||
| 220 | { | ||
| 221 | return -ENOSYS; | ||
| 222 | } | ||
| 223 | static inline void pm_genpd_poweroff_unused(void) {} | 191 | static inline void pm_genpd_poweroff_unused(void) {} |
| 224 | #endif | 192 | #endif |
| 225 | 193 | ||
| @@ -229,12 +197,6 @@ static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | |||
| 229 | return __pm_genpd_add_device(genpd, dev, NULL); | 197 | return __pm_genpd_add_device(genpd, dev, NULL); |
| 230 | } | 198 | } |
| 231 | 199 | ||
| 232 | static inline int pm_genpd_name_add_device(const char *domain_name, | ||
| 233 | struct device *dev) | ||
| 234 | { | ||
| 235 | return __pm_genpd_name_add_device(domain_name, dev, NULL); | ||
| 236 | } | ||
| 237 | |||
| 238 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP | 200 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP |
| 239 | extern void pm_genpd_syscore_poweroff(struct device *dev); | 201 | extern void pm_genpd_syscore_poweroff(struct device *dev); |
| 240 | extern void pm_genpd_syscore_poweron(struct device *dev); | 202 | extern void pm_genpd_syscore_poweron(struct device *dev); |
