summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-22 19:18:41 +0300
committerMark Brown <broonie@kernel.org>2015-12-23 15:15:41 +0300
commitd1eba93bd0fcd3f699cb8d666bc97788ee85d557 (patch)
treeac1e0e0ad5d0922d4af59c140b4c94d9610cc948 /drivers/spi/spi.c
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
downloadlinux-d1eba93bd0fcd3f699cb8d666bc97788ee85d557.tar.xz
spi: use to_spi_device
Use to_spi_device() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index e2415be209d5..70828521e6bb 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 = { \