Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754935AbbLVQTV (ORCPT ); Tue, 22 Dec 2015 11:19:21 -0500 Received: from m50-138.163.com ([123.125.50.138]:40919 "EHLO m50-138.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752497AbbLVQTT (ORCPT ); Tue, 22 Dec 2015 11:19:19 -0500 From: Geliang Tang To: Lauro Ramos Venancio , Aloisio Almeida Jr , Samuel Ortiz Cc: Geliang Tang , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] NFC: trf7970a: use to_spi_device Date: Wed, 23 Dec 2015 00:18:42 +0800 Message-Id: <8847f1817f2c8d91a93b65d87648a4e024b24190.1450800897.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: C9GowADX3J3od3lWZkFaAg--.5309S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7KFWxJrWUXr4xAw13WryrXrb_yoW8Ar48pF WUGay8GFWkCr17urn8Jr4kury3tw40k3yfC3y0k34fKw1xZry8JFy8tFy2yw15uFWUu3W7 Jay2vryUAw4Fyr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UxgA7UUUUU= X-Originating-IP: [116.77.132.150] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/xtbBygnYmVO+guM54AAAsX Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1888 Lines: 56 Use to_spi_device() instead of open-coding it. Signed-off-by: Geliang Tang --- drivers/nfc/trf7970a.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index f857feb..10842b7 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -2139,7 +2139,7 @@ static int trf7970a_remove(struct spi_device *spi) #ifdef CONFIG_PM_SLEEP static int trf7970a_suspend(struct device *dev) { - struct spi_device *spi = container_of(dev, struct spi_device, dev); + struct spi_device *spi = to_spi_device(dev); struct trf7970a *trf = spi_get_drvdata(spi); dev_dbg(dev, "Suspend\n"); @@ -2155,7 +2155,7 @@ static int trf7970a_suspend(struct device *dev) static int trf7970a_resume(struct device *dev) { - struct spi_device *spi = container_of(dev, struct spi_device, dev); + struct spi_device *spi = to_spi_device(dev); struct trf7970a *trf = spi_get_drvdata(spi); int ret; @@ -2174,7 +2174,7 @@ static int trf7970a_resume(struct device *dev) #ifdef CONFIG_PM static int trf7970a_pm_runtime_suspend(struct device *dev) { - struct spi_device *spi = container_of(dev, struct spi_device, dev); + struct spi_device *spi = to_spi_device(dev); struct trf7970a *trf = spi_get_drvdata(spi); int ret; @@ -2191,7 +2191,7 @@ static int trf7970a_pm_runtime_suspend(struct device *dev) static int trf7970a_pm_runtime_resume(struct device *dev) { - struct spi_device *spi = container_of(dev, struct spi_device, dev); + struct spi_device *spi = to_spi_device(dev); struct trf7970a *trf = spi_get_drvdata(spi); int ret; -- 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/