Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753300AbbL3O6E (ORCPT ); Wed, 30 Dec 2015 09:58:04 -0500 Received: from m50-138.163.com ([123.125.50.138]:53569 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbbL3O6B (ORCPT ); Wed, 30 Dec 2015 09:58:01 -0500 From: Geliang Tang To: Mark Brown , Moritz Fischer Cc: Geliang Tang , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] spi: cadence: use to_platform_device() Date: Wed, 30 Dec 2015 22:57:35 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: X-CM-TRANSID: C9GowACHx9vo8INWFouFBg--.47101S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJrWxXrW8Jr1fWFWxWFg_yoW8Gr1UpF 1UJay8G3yxWFWj93WfJw1DZF1ay34Sq34UKF40k39ak3sYqrykGFyrXFyrAr43JFWkCF47 Xasrt3ykZa15Zr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UonQUUUUUU= X-Originating-IP: [116.77.136.90] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiMArgmVWBTcMsCAAAs9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1506 Lines: 41 Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang Reviewed-by: Moritz Fischer --- 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/