summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-rspi.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-10-21 22:00:45 +0200
committerMark Brown <broonie@kernel.org>2018-11-05 11:54:50 +0000
commitbe0bf62e3df9afcb3f7a72de347770568dd60af6 (patch)
treeebc422c97c6de7e218ca7c712753cda7c2f2d695 /drivers/spi/spi-rspi.c
parent6eee6d317aa2511ea86c4f8f28d79bfd3d621826 (diff)
downloadlinux-be0bf62e3df9afcb3f7a72de347770568dd60af6.tar.gz
linux-be0bf62e3df9afcb3f7a72de347770568dd60af6.tar.bz2
linux-be0bf62e3df9afcb3f7a72de347770568dd60af6.zip
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-rspi.c')
-rw-r--r--drivers/spi/spi-rspi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 55f8e55327b3..a4ef641b5227 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1347,16 +1347,14 @@ MODULE_DEVICE_TABLE(platform, spi_driver_ids);
#ifdef CONFIG_PM_SLEEP
static int rspi_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct rspi_data *rspi = platform_get_drvdata(pdev);
+ struct rspi_data *rspi = dev_get_drvdata(dev);
return spi_master_suspend(rspi->master);
}
static int rspi_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct rspi_data *rspi = platform_get_drvdata(pdev);
+ struct rspi_data *rspi = dev_get_drvdata(dev);
return spi_master_resume(rspi->master);
}