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

index adf384323934a6e432183bb16bcad27090b29881..d495d860439740b4dfc82a8bed8290886591d991 100644 (file)
@@ -1426,16 +1426,14 @@ MODULE_DEVICE_TABLE(platform, spi_driver_ids);
 #ifdef CONFIG_PM_SLEEP
 static int sh_msiof_spi_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
+       struct sh_msiof_spi_priv *p = dev_get_drvdata(dev);
 
        return spi_master_suspend(p->master);
 }
 
 static int sh_msiof_spi_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
+       struct sh_msiof_spi_priv *p = dev_get_drvdata(dev);
 
        return spi_master_resume(p->master);
 }