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

gpio: xilinx: 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: Bartosz Golaszewski <brgl@bgdev.pl>

authored by

Wolfram Sang and committed by
Bartosz Golaszewski
e24b9fc1 21038680

+2 -4
+2 -4
drivers/gpio/gpio-xilinx.c
··· 371 371 372 372 static int __maybe_unused xgpio_runtime_suspend(struct device *dev) 373 373 { 374 - struct platform_device *pdev = to_platform_device(dev); 375 - struct xgpio_instance *gpio = platform_get_drvdata(pdev); 374 + struct xgpio_instance *gpio = dev_get_drvdata(dev); 376 375 377 376 clk_disable(gpio->clk); 378 377 ··· 380 381 381 382 static int __maybe_unused xgpio_runtime_resume(struct device *dev) 382 383 { 383 - struct platform_device *pdev = to_platform_device(dev); 384 - struct xgpio_instance *gpio = platform_get_drvdata(pdev); 384 + struct xgpio_instance *gpio = dev_get_drvdata(dev); 385 385 386 386 return clk_enable(gpio->clk); 387 387 }