[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <a196696aefe502e775a025cdb662c39cbdabf412.1450800897.git.geliangtang@163.com>
Date: Wed, 23 Dec 2015 00:18:41 +0800
From: Geliang Tang <geliangtang@....com>
To: Mark Brown <broonie@...nel.org>
Cc: Geliang Tang <geliangtang@....com>, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/3] spi: use to_spi_device
Use to_spi_device() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@....com>
---
drivers/spi/spi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 19659c4..2ae1588 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -84,8 +84,7 @@ static ssize_t spi_device_##field##_show(struct device *dev, \
struct device_attribute *attr, \
char *buf) \
{ \
- struct spi_device *spi = container_of(dev, \
- struct spi_device, dev); \
+ struct spi_device *spi = to_spi_device(dev); \
return spi_statistics_##field##_show(&spi->statistics, buf); \
} \
static struct device_attribute dev_attr_spi_device_##field = { \
--
2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists