diff mbox series

power: supply: Fix the simple battery property names

Message ID 20190318133629.17144-1-maxime.ripard@bootlin.com (mailing list archive)
State Not Applicable, archived
Headers show
Series power: supply: Fix the simple battery property names | expand

Commit Message

Maxime Ripard March 18, 2019, 1:36 p.m. UTC
Commit c08b1f45d7d1 ("power: supply: core: Add power_supply_battery_info
and API") introduced code to parse the simple-battery node and express
battery charging constraints. However, it parsed that node using the
properties constant_charge_current_max_microamp and
constant_charge_voltage_max_microvolt, while the device tree binding for
the simple-battery node uses dashes to separate the words in those
properties (constant-charge-current-max-microamp and
constant-charge-voltage-max-microvolt).

Let's make the code match the binding.

Fixes: c08b1f45d7d1 ("power: supply: core: Add power_supply_battery_info and API")
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 drivers/power/supply/power_supply_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Maxime Ripard April 2, 2019, 1:22 p.m. UTC | #1
On Mon, Mar 18, 2019 at 02:36:29PM +0100, Maxime Ripard wrote:
> Commit c08b1f45d7d1 ("power: supply: core: Add power_supply_battery_info
> and API") introduced code to parse the simple-battery node and express
> battery charging constraints. However, it parsed that node using the
> properties constant_charge_current_max_microamp and
> constant_charge_voltage_max_microvolt, while the device tree binding for
> the simple-battery node uses dashes to separate the words in those
> properties (constant-charge-current-max-microamp and
> constant-charge-voltage-max-microvolt).
>
> Let's make the code match the binding.
>
> Fixes: c08b1f45d7d1 ("power: supply: core: Add power_supply_battery_info and API")
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Ping?

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Sebastian Reichel April 5, 2019, 2:02 p.m. UTC | #2
Hi,

On Tue, Apr 02, 2019 at 03:22:45PM +0200, Maxime Ripard wrote:
> On Mon, Mar 18, 2019 at 02:36:29PM +0100, Maxime Ripard wrote:
> > Commit c08b1f45d7d1 ("power: supply: core: Add power_supply_battery_info
> > and API") introduced code to parse the simple-battery node and express
> > battery charging constraints. However, it parsed that node using the
> > properties constant_charge_current_max_microamp and
> > constant_charge_voltage_max_microvolt, while the device tree binding for
> > the simple-battery node uses dashes to separate the words in those
> > properties (constant-charge-current-max-microamp and
> > constant-charge-voltage-max-microvolt).
> >
> > Let's make the code match the binding.
> >
> > Fixes: c08b1f45d7d1 ("power: supply: core: Add power_supply_battery_info and API")
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> 
> Ping?
> 
> Maxime

Pong. Sorry for the delay, queued.

-- Sebastian
diff mbox series

Patch

diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index c917a8b43b2b..ae9c9d1d437c 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -620,9 +620,9 @@  int power_supply_get_battery_info(struct power_supply *psy,
 			     &info->precharge_current_ua);
 	of_property_read_u32(battery_np, "charge-term-current-microamp",
 			     &info->charge_term_current_ua);
-	of_property_read_u32(battery_np, "constant_charge_current_max_microamp",
+	of_property_read_u32(battery_np, "constant-charge-current-max-microamp",
 			     &info->constant_charge_current_max_ua);
-	of_property_read_u32(battery_np, "constant_charge_voltage_max_microvolt",
+	of_property_read_u32(battery_np, "constant-charge-voltage-max-microvolt",
 			     &info->constant_charge_voltage_max_uv);
 	of_property_read_u32(battery_np, "factory-internal-resistance-micro-ohms",
 			     &info->factory_internal_resistance_uohm);