Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: gpio-dwapb: simplify getting .driver_data

We should get 'driver_data' 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: Linus Walleij <linus.walleij@linaro.org>

authored by

Wolfram Sang and committed by
Linus Walleij
deb19ac5 2646b90d

+2 -4
+2 -4
drivers/gpio/gpio-dwapb.c
··· 748 748 #ifdef CONFIG_PM_SLEEP 749 749 static int dwapb_gpio_suspend(struct device *dev) 750 750 { 751 - struct platform_device *pdev = to_platform_device(dev); 752 - struct dwapb_gpio *gpio = platform_get_drvdata(pdev); 751 + struct dwapb_gpio *gpio = dev_get_drvdata(dev); 753 752 struct gpio_chip *gc = &gpio->ports[0].gc; 754 753 unsigned long flags; 755 754 int i; ··· 792 793 793 794 static int dwapb_gpio_resume(struct device *dev) 794 795 { 795 - struct platform_device *pdev = to_platform_device(dev); 796 - struct dwapb_gpio *gpio = platform_get_drvdata(pdev); 796 + struct dwapb_gpio *gpio = dev_get_drvdata(dev); 797 797 struct gpio_chip *gc = &gpio->ports[0].gc; 798 798 unsigned long flags; 799 799 int i;