Skip to content

Commit e24b9fc

Browse files
Wolfram Sangbrgl
authored andcommitted
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 <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 2103868 commit e24b9fc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpio/gpio-xilinx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,7 @@ static int __maybe_unused xgpio_resume(struct device *dev)
371371

372372
static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
373373
{
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);
376375

377376
clk_disable(gpio->clk);
378377

@@ -381,8 +380,7 @@ static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
381380

382381
static int __maybe_unused xgpio_runtime_resume(struct device *dev)
383382
{
384-
struct platform_device *pdev = to_platform_device(dev);
385-
struct xgpio_instance *gpio = platform_get_drvdata(pdev);
383+
struct xgpio_instance *gpio = dev_get_drvdata(dev);
386384

387385
return clk_enable(gpio->clk);
388386
}

0 commit comments

Comments
 (0)