Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753927AbbL3O7A (ORCPT ); Wed, 30 Dec 2015 09:59:00 -0500 Received: from m50-138.163.com ([123.125.50.138]:57173 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753351AbbL3O6o (ORCPT ); Wed, 30 Dec 2015 09:58:44 -0500 From: Geliang Tang To: Mark Brown , Michal Simek , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Moritz Fischer Cc: Geliang Tang , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] spi: zynq: use to_platform_device() Date: Wed, 30 Dec 2015 22:57:36 +0800 Message-Id: <917c5adcc61a2a9e6390c0fe54445aa7c8642462.1451485340.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: C9GowADH9BDx8INWf4yFBg--.10966S3 X-Coremail-Antispam: 1Uf129KBjvPXoW8KF1rWFWUtr18uFy8uw45p5X_Gr45ZoWxtr n3Ww4rGr43GayDA3yktFy3Z3W7uws8Gw1DGw1v9ws8tw1Ygry3Ww13Wr18Zr4fKF4xG347 Cwn8GrZ7XFy8n29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3AaLa J3UbIYCTnIWIevJa73UjIFyTuYvjxU1pnmDUUUU X-Originating-IP: [116.77.136.90] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbivxLgmVWBPU82bgAAsq Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1562 Lines: 43 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang Reviewed-by: Moritz Fischer --- drivers/spi/spi-zynqmp-gqspi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index f23f36e..aab9b49 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; -- 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/