mtd: st_spi_fsm: Avoid duplicating MTD core code
authorLee Jones <lee.jones@linaro.org>
Thu, 20 Mar 2014 11:11:44 +0000 (11:11 +0000)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 20 Mar 2014 11:56:51 +0000 (04:56 -0700)
Reported-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/devices/st_spi_fsm.c

index d1fb1e55aff76272f4112be9bbd596be3a042743..80088e4880aa436e35aa375c132368713b7089e5 100644 (file)
@@ -1729,14 +1729,6 @@ static int stfsm_mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
 
        dev_dbg(fsm->dev, "%s to 0x%08x, len %zd\n", __func__, (u32)to, len);
 
-       *retlen = 0;
-
-       if (!len)
-               return 0;
-
-       if (to + len > mtd->size)
-               return -EINVAL;
-
        /* Offset within page */
        page_offs = to % FLASH_PAGESIZE;