mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
power: supply: bq24257_charger: 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-14-9d8c9d24cfe4@weissschuh.net Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
f11ebcdeb9
commit
72ad51a623
|
|
@ -759,7 +759,7 @@ static ssize_t bq24257_show_ovp_voltage(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 bq24257_device *bq = power_supply_get_drvdata(psy);
|
||||
|
||||
return sysfs_emit(buf, "%u\n", bq24257_vovp_map[bq->init_data.vovp]);
|
||||
|
|
@ -769,7 +769,7 @@ static ssize_t bq24257_show_in_dpm_voltage(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 bq24257_device *bq = power_supply_get_drvdata(psy);
|
||||
|
||||
return sysfs_emit(buf, "%u\n", bq24257_vindpm_map[bq->init_data.vindpm]);
|
||||
|
|
@ -779,7 +779,7 @@ static ssize_t bq24257_sysfs_show_enable(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 bq24257_device *bq = power_supply_get_drvdata(psy);
|
||||
int ret;
|
||||
|
||||
|
|
@ -801,7 +801,7 @@ static ssize_t bq24257_sysfs_set_enable(struct device *dev,
|
|||
const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
struct power_supply *psy = dev_get_drvdata(dev);
|
||||
struct power_supply *psy = dev_to_psy(dev);
|
||||
struct bq24257_device *bq = power_supply_get_drvdata(psy);
|
||||
long val;
|
||||
int ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user