Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: surface_battery: use dev_to_psy()

Use the new, explicit accessor to go from a 'struct device' to its
'struct power_supply'.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241210-power-supply-dev_to_psy-v2-11-9d8c9d24cfe4@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Thomas Weißschuh and committed by
Sebastian Reichel
6d99e506 1f4971fd

+2 -2
+2 -2
drivers/power/supply/surface_battery.c
··· 667 667 668 668 static ssize_t alarm_show(struct device *dev, struct device_attribute *attr, char *buf) 669 669 { 670 - struct power_supply *psy = dev_get_drvdata(dev); 670 + struct power_supply *psy = dev_to_psy(dev); 671 671 struct spwr_battery_device *bat = power_supply_get_drvdata(psy); 672 672 int status; 673 673 ··· 681 681 static ssize_t alarm_store(struct device *dev, struct device_attribute *attr, const char *buf, 682 682 size_t count) 683 683 { 684 - struct power_supply *psy = dev_get_drvdata(dev); 684 + struct power_supply *psy = dev_to_psy(dev); 685 685 struct spwr_battery_device *bat = power_supply_get_drvdata(psy); 686 686 unsigned long value; 687 687 int status;