diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 17:16:34 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 17:16:34 +0200 |
commit | 4961ab934a1254b1ad9420cea0ded617b57f022b (patch) | |
tree | f48ee16ff167f1b54ef6608986ba8155194610b4 /drivers/power | |
parent | auxdisplay: section cleanup in cfag12864bfb driver (diff) | |
parent | power_supply: Fix regression for 'type' property (diff) | |
download | linux-4961ab934a1254b1ad9420cea0ded617b57f022b.tar.xz linux-4961ab934a1254b1ad9420cea0ded617b57f022b.zip |
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 6a86cdfd79fa..9d30eeb8c810 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, { struct device *dev = container_of(kobj, struct device, kobj); struct power_supply *psy = dev_get_drvdata(dev); + mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; int i; + if (attrno == POWER_SUPPLY_PROP_TYPE) + return mode; + for (i = 0; i < psy->num_properties; i++) { int property = psy->properties[i]; if (property == attrno) { - mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; - if (psy->property_is_writeable && psy->property_is_writeable(psy, property) > 0) mode |= S_IWUSR; |