diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:16:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:16:34 -0400 |
commit | 4961ab934a1254b1ad9420cea0ded617b57f022b (patch) | |
tree | f48ee16ff167f1b54ef6608986ba8155194610b4 /drivers/power | |
parent | bf87eae94880f1b79c2828d8705f0d97e961f168 (diff) | |
parent | bbabb158f0e9d41174ae5c2183a8e4f981daf6ce (diff) |
Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
power_supply: Fix regression for 'type' property
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 6a86cdfd79f..9d30eeb8c81 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c | |||
@@ -179,14 +179,16 @@ static mode_t power_supply_attr_is_visible(struct kobject *kobj, | |||
179 | { | 179 | { |
180 | struct device *dev = container_of(kobj, struct device, kobj); | 180 | struct device *dev = container_of(kobj, struct device, kobj); |
181 | struct power_supply *psy = dev_get_drvdata(dev); | 181 | struct power_supply *psy = dev_get_drvdata(dev); |
182 | mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; | ||
182 | int i; | 183 | int i; |
183 | 184 | ||
185 | if (attrno == POWER_SUPPLY_PROP_TYPE) | ||
186 | return mode; | ||
187 | |||
184 | for (i = 0; i < psy->num_properties; i++) { | 188 | for (i = 0; i < psy->num_properties; i++) { |
185 | int property = psy->properties[i]; | 189 | int property = psy->properties[i]; |
186 | 190 | ||
187 | if (property == attrno) { | 191 | if (property == attrno) { |
188 | mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; | ||
189 | |||
190 | if (psy->property_is_writeable && | 192 | if (psy->property_is_writeable && |
191 | psy->property_is_writeable(psy, property) > 0) | 193 | psy->property_is_writeable(psy, property) > 0) |
192 | mode |= S_IWUSR; | 194 | mode |= S_IWUSR; |