1
0
Fork 0

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>
hifive-unleashed-5.1
Geliang Tang 2015-12-23 20:54:33 +08:00 committed by Alexandre Belloni
parent bf035f4234
commit 54dd1c4c29
1 changed files with 2 additions and 2 deletions

View File

@ -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);