summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-04-19 16:06:11 +0200
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>2018-04-25 23:15:51 +0200
commitbb772d0fdf73a0ff80ce8bc7ba3d13c240aef3df (patch)
treefdaf773631a376271306e73dc91d6a73cf019417 /drivers/power
parentpower: supply: bq27xxx: Add support for BQ27426 (diff)
downloadlinux-bb772d0fdf73a0ff80ce8bc7ba3d13c240aef3df.tar.xz
linux-bb772d0fdf73a0ff80ce8bc7ba3d13c240aef3df.zip
power: supply: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/gpio-charger.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/power/supply/gpio-charger.c b/drivers/power/supply/gpio-charger.c
index bd2468ca6b63..c3f2a9479468 100644
--- a/drivers/power/supply/gpio-charger.c
+++ b/drivers/power/supply/gpio-charger.c
@@ -212,8 +212,7 @@ static int gpio_charger_suspend(struct device *dev)
static int gpio_charger_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct gpio_charger *gpio_charger = platform_get_drvdata(pdev);
+ struct gpio_charger *gpio_charger = dev_get_drvdata(dev);
if (device_may_wakeup(dev) && gpio_charger->wakeup_enabled)
disable_irq_wake(gpio_charger->irq);