aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/power_supply_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/power_supply_sysfs.c')
-rw-r--r--drivers/power/power_supply_sysfs.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 750a20275664..62653f50a524 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -73,19 +73,20 @@ static ssize_t power_supply_show_property(struct device *dev,
73 const ptrdiff_t off = attr - power_supply_attrs; 73 const ptrdiff_t off = attr - power_supply_attrs;
74 union power_supply_propval value; 74 union power_supply_propval value;
75 75
76 if (off == POWER_SUPPLY_PROP_TYPE) 76 if (off == POWER_SUPPLY_PROP_TYPE) {
77 value.intval = psy->type; 77 value.intval = psy->type;
78 else 78 } else {
79 ret = psy->get_property(psy, off, &value); 79 ret = psy->get_property(psy, off, &value);
80 80
81 if (ret < 0) { 81 if (ret < 0) {
82 if (ret == -ENODATA) 82 if (ret == -ENODATA)
83 dev_dbg(dev, "driver has no data for `%s' property\n", 83 dev_dbg(dev, "driver has no data for `%s' property\n",
84 attr->attr.name); 84 attr->attr.name);
85 else if (ret != -ENODEV) 85 else if (ret != -ENODEV)
86 dev_err(dev, "driver failed to report `%s' property: %zd\n", 86 dev_err(dev, "driver failed to report `%s' property: %zd\n",
87 attr->attr.name, ret); 87 attr->attr.name, ret);
88 return ret; 88 return ret;
89 }
89 } 90 }
90 91
91 if (off == POWER_SUPPLY_PROP_STATUS) 92 if (off == POWER_SUPPLY_PROP_STATUS)
@@ -149,9 +150,11 @@ static struct device_attribute power_supply_attrs[] = {
149 POWER_SUPPLY_ATTR(voltage_now), 150 POWER_SUPPLY_ATTR(voltage_now),
150 POWER_SUPPLY_ATTR(voltage_avg), 151 POWER_SUPPLY_ATTR(voltage_avg),
151 POWER_SUPPLY_ATTR(voltage_ocv), 152 POWER_SUPPLY_ATTR(voltage_ocv),
153 POWER_SUPPLY_ATTR(voltage_boot),
152 POWER_SUPPLY_ATTR(current_max), 154 POWER_SUPPLY_ATTR(current_max),
153 POWER_SUPPLY_ATTR(current_now), 155 POWER_SUPPLY_ATTR(current_now),
154 POWER_SUPPLY_ATTR(current_avg), 156 POWER_SUPPLY_ATTR(current_avg),
157 POWER_SUPPLY_ATTR(current_boot),
155 POWER_SUPPLY_ATTR(power_now), 158 POWER_SUPPLY_ATTR(power_now),
156 POWER_SUPPLY_ATTR(power_avg), 159 POWER_SUPPLY_ATTR(power_avg),
157 POWER_SUPPLY_ATTR(charge_full_design), 160 POWER_SUPPLY_ATTR(charge_full_design),
@@ -193,6 +196,7 @@ static struct device_attribute power_supply_attrs[] = {
193 POWER_SUPPLY_ATTR(type), 196 POWER_SUPPLY_ATTR(type),
194 POWER_SUPPLY_ATTR(scope), 197 POWER_SUPPLY_ATTR(scope),
195 POWER_SUPPLY_ATTR(charge_term_current), 198 POWER_SUPPLY_ATTR(charge_term_current),
199 POWER_SUPPLY_ATTR(calibrate),
196 /* Properties of type `const char *' */ 200 /* Properties of type `const char *' */
197 POWER_SUPPLY_ATTR(model_name), 201 POWER_SUPPLY_ATTR(model_name),
198 POWER_SUPPLY_ATTR(manufacturer), 202 POWER_SUPPLY_ATTR(manufacturer),