power: supply: bq24190_charger: use dev_to_psy()
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 10 Dec 2024 21:56:00 +0000 (22:56 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 11 Dec 2024 01:00:25 +0000 (02:00 +0100)
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-13-9d8c9d24cfe4@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq24190_charger.c

index 3b97f788496795b321c12ee69df29c701cb83031..b71e21a0196a4becace5233c1cbe89c24e2004e2 100644 (file)
@@ -480,7 +480,7 @@ static struct bq24190_sysfs_field_info *bq24190_sysfs_field_lookup(
 static ssize_t bq24190_sysfs_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 bq24190_dev_info *bdi = power_supply_get_drvdata(psy);
        struct bq24190_sysfs_field_info *info;
        ssize_t count;
@@ -510,7 +510,7 @@ static ssize_t bq24190_sysfs_show(struct device *dev,
 static ssize_t bq24190_sysfs_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 bq24190_dev_info *bdi = power_supply_get_drvdata(psy);
        struct bq24190_sysfs_field_info *info;
        int ret;