spi: mxic: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 19 Mar 2019 16:36:37 +0000 (17:36 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 20 Mar 2019 17:20:29 +0000 (17:20 +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-mxic.c

index e41ae6ef0f8af7f2a00f26ae7d0711cefed4d1bc..f48563c09b97cdb63495212f2862797f96e0958e 100644 (file)
@@ -492,8 +492,7 @@ static int mxic_spi_transfer_one(struct spi_master *master,
 
 static int __maybe_unused mxic_spi_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 mxic_spi *mxic = spi_master_get_devdata(master);
 
        mxic_spi_clk_disable(mxic);
@@ -504,8 +503,7 @@ static int __maybe_unused mxic_spi_runtime_suspend(struct device *dev)
 
 static int __maybe_unused mxic_spi_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 mxic_spi *mxic = spi_master_get_devdata(master);
        int ret;