mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
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>
This commit is contained in:
parent
1f4971fd33
commit
6d99e50663
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue