Commit 46d0c03c authored by Sebastian Reichel's avatar Sebastian Reichel
Browse files

power: supply: all: switch psy_cfg from of_node to fwnode



When registering a power-supply device, either a of_node or the more
recent fwnode can be supplied. Since fwnode can also contain an of_node,
let's try to get rid of it.

Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20250225-psy-core-convert-to-fwnode-v1-4-d5e4369936bb@collabora.com


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 13425403
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3494,11 +3494,11 @@ static int ab8500_charger_probe(struct platform_device *pdev)
	di->invalid_charger_detect_state = 0;

	/* AC and USB supply config */
	ac_psy_cfg.of_node = np;
	ac_psy_cfg.fwnode = dev_fwnode(dev);
	ac_psy_cfg.supplied_to = supply_interface;
	ac_psy_cfg.num_supplicants = ARRAY_SIZE(supply_interface);
	ac_psy_cfg.drv_data = &di->ac_chg;
	usb_psy_cfg.of_node = np;
	usb_psy_cfg.fwnode = dev_fwnode(dev);
	usb_psy_cfg.supplied_to = supply_interface;
	usb_psy_cfg.num_supplicants = ARRAY_SIZE(supply_interface);
	usb_psy_cfg.drv_data = &di->usb_chg;
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/property.h>

enum {
	REG_CAPACITY,
@@ -231,7 +232,7 @@ static int a500_battery_probe(struct platform_device *pdev)

	platform_set_drvdata(pdev, bat);

	psy_cfg.of_node = pdev->dev.parent->of_node;
	psy_cfg.fwnode = dev_fwnode(pdev->dev.parent);
	psy_cfg.drv_data = bat;
	psy_cfg.no_wakeup_source = true;

+1 −1
Original line number Diff line number Diff line
@@ -614,7 +614,7 @@ static int act8945a_charger_probe(struct platform_device *pdev)
	if (ret)
		return -EINVAL;

	psy_cfg.of_node	= pdev->dev.of_node;
	psy_cfg.fwnode	= dev_fwnode(&pdev->dev);
	psy_cfg.drv_data = charger;

	charger->psy = devm_power_supply_register(&pdev->dev,
+1 −1
Original line number Diff line number Diff line
@@ -364,7 +364,7 @@ static int axp20x_ac_power_probe(struct platform_device *pdev)

	platform_set_drvdata(pdev, power);

	psy_cfg.of_node = pdev->dev.of_node;
	psy_cfg.fwnode = dev_fwnode(&pdev->dev);
	psy_cfg.drv_data = power;

	power->supply = devm_power_supply_register(&pdev->dev,
+1 −1
Original line number Diff line number Diff line
@@ -1112,7 +1112,7 @@ static int axp20x_power_probe(struct platform_device *pdev)
	platform_set_drvdata(pdev, axp20x_batt);

	psy_cfg.drv_data = axp20x_batt;
	psy_cfg.of_node = pdev->dev.of_node;
	psy_cfg.fwnode = dev_fwnode(&pdev->dev);

	axp20x_batt->data = (struct axp_data *)of_device_get_match_data(dev);

Loading