]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/chips/cfi_cmdset_0002.c
mtd: move zero length verification to MTD API functions
[karo-tx-linux.git] / drivers / mtd / chips / cfi_cmdset_0002.c
index a89d899efad4e5bcfba7b6ed4ff69b52f7ede977..c1d4624ce6e733fe097193799496c234f9da8764 100644 (file)
@@ -1246,9 +1246,6 @@ static int cfi_amdstd_write_words(struct mtd_info *mtd, loff_t to, size_t len,
        unsigned long ofs, chipstart;
        DECLARE_WAITQUEUE(wait, current);
 
-       if (!len)
-               return 0;
-
        chipnum = to >> cfi->chipshift;
        ofs = to  - (chipnum << cfi->chipshift);
        chipstart = cfi->chips[chipnum].start;
@@ -1487,9 +1484,6 @@ static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
        int chipnum;
        unsigned long ofs;
 
-       if (!len)
-               return 0;
-
        chipnum = to >> cfi->chipshift;
        ofs = to  - (chipnum << cfi->chipshift);
 
@@ -1697,9 +1691,6 @@ static int cfi_amdstd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
        int ret = 0;
        int chipnum;
 
-       if (!len)
-               return 0;
-
        chipnum = to >> cfi->chipshift;
        ofs = to - (chipnum << cfi->chipshift);
        chipstart = cfi->chips[chipnum].start;