summaryrefslogtreecommitdiffstats
path: root/drivers/power/power_supply_sysfs.c
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-12-02 22:24:51 +0100
committerAnton Vorontsov <avorontsov@ru.mvista.com>2009-12-02 22:38:06 +0100
commit9d233e8bb92e355fd20b14745c1d9ff402e0e685 (patch)
tree8046983fd1d9a89a34e61619f35be6b3ec78789c /drivers/power/power_supply_sysfs.c
parentwm831x_backup: Remove unused variables (diff)
downloadlinux-9d233e8bb92e355fd20b14745c1d9ff402e0e685.tar.xz
linux-9d233e8bb92e355fd20b14745c1d9ff402e0e685.zip
power_supply_sysfs: Handle -ENODATA in a special way
There are cases when some device can not report any meaningful value, e.g. TWL4030 charger can report voltage only when charging is active. In these cases drivers will return -ENODATA, and we shouldn't flood kernel log with error messages. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Diffstat (limited to 'drivers/power/power_supply_sysfs.c')
-rw-r--r--drivers/power/power_supply_sysfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 08144393d64b..c790e0c77d4b 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -65,7 +65,10 @@ static ssize_t power_supply_show_property(struct device *dev,
ret = psy->get_property(psy, off, &value);
if (ret < 0) {
- if (ret != -ENODEV)
+ if (ret == -ENODATA)
+ dev_dbg(dev, "driver has no data for `%s' property\n",
+ attr->attr.name);
+ else if (ret != -ENODEV)
dev_err(dev, "driver failed to report `%s' property\n",
attr->attr.name);
return ret;