aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/power/supply/surface_battery.c
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-12-10 22:55:58 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2024-12-11 02:00:25 +0100
commit6d99e50663f61db460a2b09ad1feef069b013182 (patch)
tree4abe725472ff3d1467e1167a3afc8c66502f0efd /drivers/power/supply/surface_battery.c
parentpower: supply: ab8500: use dev_to_psy() (diff)
downloadwireguard-linux-6d99e50663f61db460a2b09ad1feef069b013182.tar.xz
wireguard-linux-6d99e50663f61db460a2b09ad1feef069b013182.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/power/supply/surface_battery.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/supply/surface_battery.c b/drivers/power/supply/surface_battery.c
index ebd1edde28f1..c759add4df49 100644
--- a/drivers/power/supply/surface_battery.c
+++ b/drivers/power/supply/surface_battery.c
@@ -667,7 +667,7 @@ out:
static ssize_t alarm_show(struct device *dev, struct device_attribute *attr, char *buf)
{
- struct power_supply *psy = dev_get_drvdata(dev);
+ struct power_supply *psy = dev_to_psy(dev);
struct spwr_battery_device *bat = power_supply_get_drvdata(psy);
int status;
@@ -681,7 +681,7 @@ static ssize_t alarm_show(struct device *dev, struct device_attribute *attr, cha
static ssize_t alarm_store(struct device *dev, struct device_attribute *attr, const char *buf,
size_t count)
{
- struct power_supply *psy = dev_get_drvdata(dev);
+ struct power_supply *psy = dev_to_psy(dev);
struct spwr_battery_device *bat = power_supply_get_drvdata(psy);
unsigned long value;
int status;