diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-04-19 10:06:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-04-20 12:53:20 -0400 |
commit | e1f16b0493a01820a137ebbdd96bf695e427fabe (patch) | |
tree | 9559888068f86579f502c96cbadbaf307fb4e9d9 /drivers/spi | |
parent | 7956fadd40af82cec610a0ccf1ca937e0dfecf94 (diff) |
spi: simplify getting .drvdata
We should get drvdata 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>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-cadence.c | 6 | ||||
-rw-r--r-- | drivers/spi/spi-zynqmp-gqspi.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 5c9516ae4942..de394422b611 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c | |||
@@ -686,8 +686,7 @@ static int cdns_spi_remove(struct platform_device *pdev) | |||
686 | */ | 686 | */ |
687 | static int __maybe_unused cdns_spi_suspend(struct device *dev) | 687 | static int __maybe_unused cdns_spi_suspend(struct device *dev) |
688 | { | 688 | { |
689 | struct platform_device *pdev = to_platform_device(dev); | 689 | struct spi_master *master = dev_get_drvdata(dev); |
690 | struct spi_master *master = platform_get_drvdata(pdev); | ||
691 | 690 | ||
692 | return spi_master_suspend(master); | 691 | return spi_master_suspend(master); |
693 | } | 692 | } |
@@ -702,8 +701,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev) | |||
702 | */ | 701 | */ |
703 | static int __maybe_unused cdns_spi_resume(struct device *dev) | 702 | static int __maybe_unused cdns_spi_resume(struct device *dev) |
704 | { | 703 | { |
705 | struct platform_device *pdev = to_platform_device(dev); | 704 | struct spi_master *master = dev_get_drvdata(dev); |
706 | struct spi_master *master = platform_get_drvdata(pdev); | ||
707 | struct cdns_spi *xspi = spi_master_get_devdata(master); | 705 | struct cdns_spi *xspi = spi_master_get_devdata(master); |
708 | 706 | ||
709 | cdns_spi_init_hw(xspi); | 707 | cdns_spi_init_hw(xspi); |
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 26d1ac3bf496..cc4d31033494 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c | |||
@@ -906,8 +906,7 @@ static int zynqmp_qspi_start_transfer(struct spi_master *master, | |||
906 | */ | 906 | */ |
907 | static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) | 907 | static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) |
908 | { | 908 | { |
909 | struct platform_device *pdev = to_platform_device(dev); | 909 | struct spi_master *master = dev_get_drvdata(dev); |
910 | struct spi_master *master = platform_get_drvdata(pdev); | ||
911 | 910 | ||
912 | spi_master_suspend(master); | 911 | spi_master_suspend(master); |
913 | 912 | ||
@@ -927,8 +926,7 @@ static int __maybe_unused zynqmp_qspi_suspend(struct device *dev) | |||
927 | */ | 926 | */ |
928 | static int __maybe_unused zynqmp_qspi_resume(struct device *dev) | 927 | static int __maybe_unused zynqmp_qspi_resume(struct device *dev) |
929 | { | 928 | { |
930 | struct platform_device *pdev = to_platform_device(dev); | 929 | struct spi_master *master = dev_get_drvdata(dev); |
931 | struct spi_master *master = platform_get_drvdata(pdev); | ||
932 | struct zynqmp_qspi *xqspi = spi_master_get_devdata(master); | 930 | struct zynqmp_qspi *xqspi = spi_master_get_devdata(master); |
933 | int ret = 0; | 931 | int ret = 0; |
934 | 932 | ||