diff options
Diffstat (limited to 'drivers/base/power/common.c')
-rw-r--r-- | drivers/base/power/common.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index b0f138806bbc..f32b802b98f4 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c | |||
@@ -19,8 +19,8 @@ | |||
19 | * @dev: Device to handle. | 19 | * @dev: Device to handle. |
20 | * | 20 | * |
21 | * If power.subsys_data is NULL, point it to a new object, otherwise increment | 21 | * If power.subsys_data is NULL, point it to a new object, otherwise increment |
22 | * its reference counter. Return 1 if a new object has been created, otherwise | 22 | * its reference counter. Return 0 if new object has been created or refcount |
23 | * return 0 or error code. | 23 | * increased, otherwise negative error code. |
24 | */ | 24 | */ |
25 | int dev_pm_get_subsys_data(struct device *dev) | 25 | int dev_pm_get_subsys_data(struct device *dev) |
26 | { | 26 | { |
@@ -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 | ||