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>
This commit is contained in:
Wolfram Sang 2018-04-19 16:06:11 +02:00 committed by Sebastian Reichel
parent 5ef6a16033
commit bb772d0fdf
1 changed files with 1 additions and 2 deletions

View File

@ -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);