diff options
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 7a2163fa61c3..bab591ba785a 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c | |||
@@ -155,8 +155,7 @@ dynamics_failed: | |||
155 | &power_supply_attrs[psy->properties[j]]); | 155 | &power_supply_attrs[psy->properties[j]]); |
156 | statics_failed: | 156 | statics_failed: |
157 | while (i--) | 157 | while (i--) |
158 | device_remove_file(psy->dev, | 158 | device_remove_file(psy->dev, &power_supply_static_attrs[i]); |
159 | &power_supply_static_attrs[psy->properties[i]]); | ||
160 | succeed: | 159 | succeed: |
161 | return rc; | 160 | return rc; |
162 | } | 161 | } |
@@ -166,8 +165,7 @@ void power_supply_remove_attrs(struct power_supply *psy) | |||
166 | int i; | 165 | int i; |
167 | 166 | ||
168 | for (i = 0; i < ARRAY_SIZE(power_supply_static_attrs); i++) | 167 | for (i = 0; i < ARRAY_SIZE(power_supply_static_attrs); i++) |
169 | device_remove_file(psy->dev, | 168 | device_remove_file(psy->dev, &power_supply_static_attrs[i]); |
170 | &power_supply_static_attrs[i]); | ||
171 | 169 | ||
172 | for (i = 0; i < psy->num_properties; i++) | 170 | for (i = 0; i < psy->num_properties; i++) |
173 | device_remove_file(psy->dev, | 171 | device_remove_file(psy->dev, |