Commit 4961ab93 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.infradead.org/battery-2.6

* git://git.infradead.org/battery-2.6:
  power_supply: Fix regression for 'type' property
parents bf87eae9 bbabb158
...@@ -179,14 +179,16 @@ static mode_t power_supply_attr_is_visible(struct kobject *kobj, ...@@ -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 device *dev = container_of(kobj, struct device, kobj);
struct power_supply *psy = dev_get_drvdata(dev); struct power_supply *psy = dev_get_drvdata(dev);
mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
int i; int i;
if (attrno == POWER_SUPPLY_PROP_TYPE)
return mode;
for (i = 0; i < psy->num_properties; i++) { for (i = 0; i < psy->num_properties; i++) {
int property = psy->properties[i]; int property = psy->properties[i];
if (property == attrno) { if (property == attrno) {
mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
if (psy->property_is_writeable && if (psy->property_is_writeable &&
psy->property_is_writeable(psy, property) > 0) psy->property_is_writeable(psy, property) > 0)
mode |= S_IWUSR; mode |= S_IWUSR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment