diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 7a2163fa61c3591d9b9c97420997bb4142bd3404..bab591ba785a0a492e98b4b3ecb95c29ede60261 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -155,8 +155,7 @@ int power_supply_create_attrs(struct power_supply *psy) &power_supply_attrs[psy->properties[j]]); statics_failed: while (i--) - device_remove_file(psy->dev, - &power_supply_static_attrs[psy->properties[i]]); + device_remove_file(psy->dev, &power_supply_static_attrs[i]); succeed: return rc; } @@ -166,8 +165,7 @@ void power_supply_remove_attrs(struct power_supply *psy) int i; for (i = 0; i < ARRAY_SIZE(power_supply_static_attrs); i++) - device_remove_file(psy->dev, - &power_supply_static_attrs[i]); + device_remove_file(psy->dev, &power_supply_static_attrs[i]); for (i = 0; i < psy->num_properties; i++) device_remove_file(psy->dev,