mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
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>
This commit is contained in:
parent
0e19dbb73e
commit
9d233e8bb9
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue