Add two new functions with easier to use and safer APIs. Switch over a bunch of in-tree users. The first commit is not directly related but fits the general theme of the series. Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx> --- Thomas Weißschuh (14): power: supply: mm8013: use accessor for driver data power: supply: core: introduce power_supply_for_each_psy() power: supply: core: use power_supply_for_each_psy() power: supply: ab8500: use power_supply_for_each_psy() power: supply: apm_power: use power_supply_for_each_psy() power: supply: core: remove power_supply_for_each_device() power: supply: core: introduce dev_to_psy() power: supply: core: use dev_to_psy() power: supply: sysfs: use dev_to_psy() power: supply: ab8500: use dev_to_psy() power: supply: surface_battery: use dev_to_psy() power: supply: bq2415x_charger: use dev_to_psy() power: supply: bq24190_charger: use dev_to_psy() power: supply: bq24257_charger: use dev_to_psy() drivers/power/supply/ab8500_btemp.c | 5 +-- drivers/power/supply/ab8500_chargalg.c | 5 +-- drivers/power/supply/ab8500_charger.c | 5 +-- drivers/power/supply/ab8500_fg.c | 33 ++++++++-------- drivers/power/supply/apm_power.c | 6 +-- drivers/power/supply/bq2415x_charger.c | 24 +++++------ drivers/power/supply/bq24190_charger.c | 4 +- drivers/power/supply/bq24257_charger.c | 8 ++-- drivers/power/supply/mm8013.c | 2 +- drivers/power/supply/power_supply_core.c | 66 ++++++++++++++++++------------- drivers/power/supply/power_supply_sysfs.c | 8 ++-- drivers/power/supply/surface_battery.c | 4 +- include/linux/power_supply.h | 4 +- 13 files changed, 92 insertions(+), 82 deletions(-) --- base-commit: 39f3bd9c9a27d526858da153090376decdf7bfea change-id: 20241208-power-supply-dev_to_psy-fb3fa4e1fa6a Best regards, -- Thomas Weißschuh <linux@xxxxxxxxxxxxxx>