summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-zynqmp-gqspi.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-01 13:29:00 +0100
committerMark Brown <broonie@kernel.org>2016-01-05 12:34:37 +0100
commit9d0c1c3332b49570454bb11e55d3c6c7993163da (patch)
tree10e756e5a574ebfdbda6bdf74766e83b083dfc25 /drivers/spi/spi-zynqmp-gqspi.c
parentLinux 4.4-rc1 (diff)
downloadlinux-9d0c1c3332b49570454bb11e55d3c6c7993163da.tar.xz
linux-9d0c1c3332b49570454bb11e55d3c6c7993163da.zip
spi: zynq: use to_platform_device()
Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-zynqmp-gqspi.c')
-rw-r--r--drivers/spi/spi-zynqmp-gqspi.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index f23f36ebaf3d..aab9b492c627 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -917,9 +917,7 @@ static int zynqmp_qspi_start_transfer(struct spi_master *master,
*/
static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
{
- struct platform_device *pdev = container_of(dev,
- struct platform_device,
- dev);
+ struct platform_device *pdev = to_platform_device(dev);
struct spi_master *master = platform_get_drvdata(pdev);
spi_master_suspend(master);
@@ -940,9 +938,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev)
*/
static int __maybe_unused zynqmp_qspi_resume(struct device *dev)
{
- struct platform_device *pdev = container_of(dev,
- struct platform_device,
- dev);
+ struct platform_device *pdev = to_platform_device(dev);
struct spi_master *master = platform_get_drvdata(pdev);
struct zynqmp_qspi *xqspi = spi_master_get_devdata(master);
int ret = 0;