diff options
Diffstat (limited to 'drivers/power/power_supply_sysfs.c')
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 08144393d64b..5b6e352ac7c1 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/ctype.h> | 14 | #include <linux/ctype.h> |
15 | #include <linux/power_supply.h> | 15 | #include <linux/power_supply.h> |
16 | #include <linux/slab.h> | ||
16 | 17 | ||
17 | #include "power_supply.h" | 18 | #include "power_supply.h" |
18 | 19 | ||
@@ -65,7 +66,10 @@ static ssize_t power_supply_show_property(struct device *dev, | |||
65 | ret = psy->get_property(psy, off, &value); | 66 | ret = psy->get_property(psy, off, &value); |
66 | 67 | ||
67 | if (ret < 0) { | 68 | if (ret < 0) { |
68 | if (ret != -ENODEV) | 69 | if (ret == -ENODATA) |
70 | dev_dbg(dev, "driver has no data for `%s' property\n", | ||
71 | attr->attr.name); | ||
72 | else if (ret != -ENODEV) | ||
69 | dev_err(dev, "driver failed to report `%s' property\n", | 73 | dev_err(dev, "driver failed to report `%s' property\n", |
70 | attr->attr.name); | 74 | attr->attr.name); |
71 | return ret; | 75 | return ret; |
@@ -96,6 +100,7 @@ static struct device_attribute power_supply_attrs[] = { | |||
96 | POWER_SUPPLY_ATTR(present), | 100 | POWER_SUPPLY_ATTR(present), |
97 | POWER_SUPPLY_ATTR(online), | 101 | POWER_SUPPLY_ATTR(online), |
98 | POWER_SUPPLY_ATTR(technology), | 102 | POWER_SUPPLY_ATTR(technology), |
103 | POWER_SUPPLY_ATTR(cycle_count), | ||
99 | POWER_SUPPLY_ATTR(voltage_max), | 104 | POWER_SUPPLY_ATTR(voltage_max), |
100 | POWER_SUPPLY_ATTR(voltage_min), | 105 | POWER_SUPPLY_ATTR(voltage_min), |
101 | POWER_SUPPLY_ATTR(voltage_max_design), | 106 | POWER_SUPPLY_ATTR(voltage_max_design), |