diff mbox series

[10/10] power: supply: ab8500_bmdata: Use standard phandle

Message ID 20210123221908.2993388-11-linus.walleij@linaro.org
State Superseded
Headers show
Series power: supply: ab8500: refactor and isolate | expand

Commit Message

Linus Walleij Jan. 23, 2021, 10:19 p.m. UTC
Look up the battery using the "monitored-battery" phandle
as is nowadays a standard DT binding. The actual bindings
for these charger elements are not upstream so let's sort
out this mess by conforming to the standard.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/power/supply/ab8500_bmdata.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.29.2

Comments

Sebastian Reichel Jan. 28, 2021, 12:07 a.m. UTC | #1
Hi,

On Sat, Jan 23, 2021 at 11:19:08PM +0100, Linus Walleij wrote:
> Look up the battery using the "monitored-battery" phandle

> as is nowadays a standard DT binding. The actual bindings

> for these charger elements are not upstream so let's sort

> out this mess by conforming to the standard.


Am I missing something? I see binding documentation in

Documentation/devicetree/bindings/power/supply/ab8500

and 'battery' property being used by

arm/boot/dts/ste-ab8500.dtsi
arm/boot/dts/ste-ab8505.dtsi

(would be nice if we can switch to standard infrastructure
of course)

-- Sebastian

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

> ---

>  drivers/power/supply/ab8500_bmdata.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/power/supply/ab8500_bmdata.c b/drivers/power/supply/ab8500_bmdata.c

> index c2b8c0bb77e2..258f399eaf37 100644

> --- a/drivers/power/supply/ab8500_bmdata.c

> +++ b/drivers/power/supply/ab8500_bmdata.c

> @@ -499,8 +499,7 @@ int ab8500_bm_of_probe(struct device *dev,

>  	const char *btech;

>  	int i;

>  

> -	/* get phandle to 'battery-info' node */

> -	battery_node = of_parse_phandle(np, "battery", 0);

> +	battery_node = of_parse_phandle(np, "monitored-battery", 0);

>  	if (!battery_node) {

>  		dev_err(dev, "battery node or reference missing\n");

>  		return -EINVAL;

> -- 

> 2.29.2

>
diff mbox series

Patch

diff --git a/drivers/power/supply/ab8500_bmdata.c b/drivers/power/supply/ab8500_bmdata.c
index c2b8c0bb77e2..258f399eaf37 100644
--- a/drivers/power/supply/ab8500_bmdata.c
+++ b/drivers/power/supply/ab8500_bmdata.c
@@ -499,8 +499,7 @@  int ab8500_bm_of_probe(struct device *dev,
 	const char *btech;
 	int i;
 
-	/* get phandle to 'battery-info' node */
-	battery_node = of_parse_phandle(np, "battery", 0);
+	battery_node = of_parse_phandle(np, "monitored-battery", 0);
 	if (!battery_node) {
 		dev_err(dev, "battery node or reference missing\n");
 		return -EINVAL;