spi: spi-zynqmp-gqspi: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 21 Oct 2018 20:00:47 +0000 (22:00 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 5 Nov 2018 11:54:35 +0000 (11:54 +0000)
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: Mark Brown <broonie@kernel.org>
drivers/spi/spi-zynqmp-gqspi.c

index cc4d31033494348249eb79c0e32872fb15b00b37..9f83e1b17aa16b6aa934d24955e5da7773af10a7 100644 (file)
@@ -960,8 +960,7 @@ static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
  */
 static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct spi_master *master = platform_get_drvdata(pdev);
+       struct spi_master *master = dev_get_drvdata(dev);
        struct zynqmp_qspi *xqspi = spi_master_get_devdata(master);
 
        clk_disable(xqspi->refclk);
@@ -980,8 +979,7 @@ static int __maybe_unused zynqmp_runtime_suspend(struct device *dev)
  */
 static int __maybe_unused zynqmp_runtime_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct spi_master *master = platform_get_drvdata(pdev);
+       struct spi_master *master = dev_get_drvdata(dev);
        struct zynqmp_qspi *xqspi = spi_master_get_devdata(master);
        int ret;