diff options
author | Ognjen Galic <smclt30p@gmail.com> | 2018-02-07 17:58:27 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-02-22 01:27:13 +0300 |
commit | 285995d15d3b1725d021a8a274e55f2ce30ccfa0 (patch) | |
tree | 1aefa04c3ce461968403105edc9e7f5bada19475 /drivers/power/supply/ds2781_battery.c | |
parent | fa93854f7a7ed63d054405bf3779247d5300edd3 (diff) | |
download | linux-285995d15d3b1725d021a8a274e55f2ce30ccfa0.tar.xz |
power: add to_power_supply macro to the API
This patch adds the to_power_supply macro to upcast
a device to a power_supply struct.
This is needed because the same piece of code using
container_of is used in various other places, so we
abstract away such low-level operations via a macro.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ognjen Galic <smclt30p@gmail.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/power/supply/ds2781_battery.c')
-rw-r--r-- | drivers/power/supply/ds2781_battery.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/power/supply/ds2781_battery.c b/drivers/power/supply/ds2781_battery.c index efe83ef8670c..d1b5a19aae7c 100644 --- a/drivers/power/supply/ds2781_battery.c +++ b/drivers/power/supply/ds2781_battery.c @@ -54,11 +54,6 @@ to_ds2781_device_info(struct power_supply *psy) return power_supply_get_drvdata(psy); } -static inline struct power_supply *to_power_supply(struct device *dev) -{ - return dev_get_drvdata(dev); -} - static inline int ds2781_battery_io(struct ds2781_device_info *dev_info, char *buf, int addr, size_t count, int io) { |