summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1305.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-23 20:54:33 +0800
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-02-04 23:44:16 +0100
commit54dd1c4c2979d1ad127d0e615fdd0f5016a5d713 (patch)
treeaf47537f21df87157ca76ddd76b21dab96f832eb /drivers/rtc/rtc-ds1305.c
parentbf035f42344a3e790c2d37ed3ee9005311f98075 (diff)
downloadblackbird-op-linux-54dd1c4c2979d1ad127d0e615fdd0f5016a5d713.tar.gz
blackbird-op-linux-54dd1c4c2979d1ad127d0e615fdd0f5016a5d713.zip
rtc: ds1305: use to_spi_device and kobj_to_dev
For better readability, use to_spi_device() and kobj_to_dev() instead of container_of(). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1305.c')
-rw-r--r--drivers/rtc/rtc-ds1305.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c
index f39691eea736..8e41c4613e51 100644
--- a/drivers/rtc/rtc-ds1305.c
+++ b/drivers/rtc/rtc-ds1305.c
@@ -532,7 +532,7 @@ ds1305_nvram_read(struct file *filp, struct kobject *kobj,
struct spi_transfer x[2];
int status;
- spi = container_of(kobj, struct spi_device, dev.kobj);
+ spi = to_spi_device(kobj_to_dev(kobj));
addr = DS1305_NVRAM + off;
msg_init(&m, x, &addr, count, NULL, buf);
@@ -554,7 +554,7 @@ ds1305_nvram_write(struct file *filp, struct kobject *kobj,
struct spi_transfer x[2];
int status;
- spi = container_of(kobj, struct spi_device, dev.kobj);
+ spi = to_spi_device(kobj_to_dev(kobj));
addr = (DS1305_WRITE | DS1305_NVRAM) + off;
msg_init(&m, x, &addr, count, buf, NULL);
OpenPOWER on IntegriCloud