]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/rtc/rtc-ds1305.c
Merge tag 'kvm-arm-for-4.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / rtc / rtc-ds1305.c
index 12b07158a3664de6aaaa2e3f42ae2266182473be..baa5d047f9c826bbd8da5111e421d6e564ed89e8 100644 (file)
@@ -538,15 +538,6 @@ ds1305_nvram_read(struct file *filp, struct kobject *kobj,
 
        spi = container_of(kobj, struct spi_device, dev.kobj);
 
-       if (unlikely(off >= DS1305_NVRAM_LEN))
-               return 0;
-       if (count >= DS1305_NVRAM_LEN)
-               count = DS1305_NVRAM_LEN;
-       if ((off + count) > DS1305_NVRAM_LEN)
-               count = DS1305_NVRAM_LEN - off;
-       if (unlikely(!count))
-               return count;
-
        addr = DS1305_NVRAM + off;
        msg_init(&m, x, &addr, count, NULL, buf);
 
@@ -569,15 +560,6 @@ ds1305_nvram_write(struct file *filp, struct kobject *kobj,
 
        spi = container_of(kobj, struct spi_device, dev.kobj);
 
-       if (unlikely(off >= DS1305_NVRAM_LEN))
-               return -EFBIG;
-       if (count >= DS1305_NVRAM_LEN)
-               count = DS1305_NVRAM_LEN;
-       if ((off + count) > DS1305_NVRAM_LEN)
-               count = DS1305_NVRAM_LEN - off;
-       if (unlikely(!count))
-               return count;
-
        addr = (DS1305_WRITE | DS1305_NVRAM) + off;
        msg_init(&m, x, &addr, count, buf, NULL);