diff options
| -rw-r--r-- | drivers/base/power/common.c | 14 | ||||
| -rw-r--r-- | include/linux/pm.h | 2 |
2 files changed, 5 insertions, 11 deletions
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index a1ee51d43da1..f32b802b98f4 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c | |||
| @@ -56,13 +56,11 @@ EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data); | |||
| 56 | * @dev: Device to handle. | 56 | * @dev: Device to handle. |
| 57 | * | 57 | * |
| 58 | * If the reference counter of power.subsys_data is zero after dropping the | 58 | * If the reference counter of power.subsys_data is zero after dropping the |
| 59 | * reference, power.subsys_data is removed. Return 1 if that happens or 0 | 59 | * reference, power.subsys_data is removed. |
| 60 | * otherwise. | ||
| 61 | */ | 60 | */ |
| 62 | int dev_pm_put_subsys_data(struct device *dev) | 61 | void dev_pm_put_subsys_data(struct device *dev) |
| 63 | { | 62 | { |
| 64 | struct pm_subsys_data *psd; | 63 | struct pm_subsys_data *psd; |
| 65 | int ret = 1; | ||
| 66 | 64 | ||
| 67 | spin_lock_irq(&dev->power.lock); | 65 | spin_lock_irq(&dev->power.lock); |
| 68 | 66 | ||
| @@ -70,18 +68,14 @@ int dev_pm_put_subsys_data(struct device *dev) | |||
| 70 | if (!psd) | 68 | if (!psd) |
| 71 | goto out; | 69 | goto out; |
| 72 | 70 | ||
| 73 | if (--psd->refcount == 0) { | 71 | if (--psd->refcount == 0) |
| 74 | dev->power.subsys_data = NULL; | 72 | dev->power.subsys_data = NULL; |
| 75 | } else { | 73 | else |
| 76 | psd = NULL; | 74 | psd = NULL; |
| 77 | ret = 0; | ||
| 78 | } | ||
| 79 | 75 | ||
| 80 | out: | 76 | out: |
| 81 | spin_unlock_irq(&dev->power.lock); | 77 | spin_unlock_irq(&dev->power.lock); |
| 82 | kfree(psd); | 78 | kfree(psd); |
| 83 | |||
| 84 | return ret; | ||
| 85 | } | 79 | } |
| 86 | EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data); | 80 | EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data); |
| 87 | 81 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 8b5976364619..e2f1be6dd9dd 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -597,7 +597,7 @@ struct dev_pm_info { | |||
| 597 | 597 | ||
| 598 | extern void update_pm_runtime_accounting(struct device *dev); | 598 | extern void update_pm_runtime_accounting(struct device *dev); |
| 599 | extern int dev_pm_get_subsys_data(struct device *dev); | 599 | extern int dev_pm_get_subsys_data(struct device *dev); |
| 600 | extern int dev_pm_put_subsys_data(struct device *dev); | 600 | extern void dev_pm_put_subsys_data(struct device *dev); |
| 601 | 601 | ||
| 602 | /* | 602 | /* |
| 603 | * Power domains provide callbacks that are executed during system suspend, | 603 | * Power domains provide callbacks that are executed during system suspend, |
