Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1299386

[PATCH 1/2] spi: cadence: use to_platform_device()

From Geliang Tang <geliangtang@163.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] spi: cadence: use to_platform_device()
Date 2015-12-30 16:00 +0100
Message-ID <qLqoh-7VK-3@gated-at.bofh.it> (permalink)
References <qL6SC-405-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/spi/spi-cadence.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c
index 5a67498..121a413 100644
--- a/drivers/spi/spi-cadence.c
+++ b/drivers/spi/spi-cadence.c
@@ -617,8 +617,7 @@ static int cdns_spi_remove(struct platform_device *pdev)
  */
 static int __maybe_unused cdns_spi_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);
 	struct cdns_spi *xspi = spi_master_get_devdata(master);
 
@@ -641,8 +640,7 @@ static int __maybe_unused cdns_spi_suspend(struct device *dev)
  */
 static int __maybe_unused cdns_spi_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 cdns_spi *xspi = spi_master_get_devdata(master);
 	int ret = 0;
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 01/10] PM / devfreq: exynos: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
  [PATCH 02/10] spi: cadence, zynq: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    Re: [PATCH 02/10] spi: cadence, zynq: use to_platform_device() Moritz Fischer <moritz.fischer@ettus.com> - 2015-12-29 19:10 +0100
      [PATCH 1/2] spi: cadence: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-30 16:00 +0100
        Re: [PATCH 1/2] spi: cadence: use to_platform_device() Mark Brown <broonie@kernel.org> - 2015-12-30 18:10 +0100
  [PATCH 03/10] dmaengine: ppc4xx: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
  [PATCH 08/10] staging: fbtft: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
  [PATCH 06/10] net: hns: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    Re: [PATCH 06/10] net: hns: use to_platform_device() Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-27 14:30 +0100
      Re: [PATCH 06/10] net: hns: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-28 03:50 +0100
    Re: [PATCH 06/10] net: hns: use to_platform_device() David Miller <davem@davemloft.net> - 2015-12-29 21:50 +0100
  [PATCH 07/10] platform/chrome: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
  [PATCH 10/10] ARM: plat-samsung: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    Re: [PATCH 10/10] ARM: plat-samsung: use to_platform_device() Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-28 03:50 +0100
  [PATCH 05/10] mmc: cb710: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100
    Re: [PATCH 05/10] mmc: cb710: use to_platform_device() Ulf Hansson <ulf.hansson@linaro.org> - 2015-12-28 14:30 +0100
  [PATCH 04/10] i2c: st: use to_platform_device() Geliang Tang <geliangtang@163.com> - 2015-12-27 14:20 +0100

csiph-web