Commit be0bf62e authored by Wolfram Sang's avatar Wolfram Sang Committed by Mark Brown

spi: spi-rspi: 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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6eee6d31
...@@ -1347,16 +1347,14 @@ MODULE_DEVICE_TABLE(platform, spi_driver_ids); ...@@ -1347,16 +1347,14 @@ MODULE_DEVICE_TABLE(platform, spi_driver_ids);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int rspi_suspend(struct device *dev) static int rspi_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct rspi_data *rspi = dev_get_drvdata(dev);
struct rspi_data *rspi = platform_get_drvdata(pdev);
return spi_master_suspend(rspi->master); return spi_master_suspend(rspi->master);
} }
static int rspi_resume(struct device *dev) static int rspi_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct rspi_data *rspi = dev_get_drvdata(dev);
struct rspi_data *rspi = platform_get_drvdata(pdev);
return spi_master_resume(rspi->master); return spi_master_resume(rspi->master);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment