From: Geliang Tang Date: Wed, 23 Dec 2015 12:54:33 +0000 (+0800) Subject: rtc: ds1305: use to_spi_device and kobj_to_dev X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54dd1c4c2979d1ad127d0e615fdd0f5016a5d713;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Alexandre Belloni --- 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);