summaryrefslogtreecommitdiff
path: root/drivers/mtd/devices/spear_smi.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-02-06 11:27:43 (GMT)
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 23:32:19 (GMT)
commitbcb1d238716d138c9e16347fc32b3c1ae006339e (patch)
treeccb7a9aea7b77481fa3474124218521e0c32de82 /drivers/mtd/devices/spear_smi.c
parent0dd5235f51fb0eb0b8cef3fed35be39b8a06d7bd (diff)
downloadlinux-fsl-qoriq-bcb1d238716d138c9e16347fc32b3c1ae006339e.tar.xz
mtd: move zero length verification to MTD API functions
In many places in drivers we verify for the zero length, but this is very inconsistent across drivers. This is obviously the right thing to do, though. This patch moves the check to the MTD API functions instead and removes a lot of duplication. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices/spear_smi.c')
-rw-r--r--drivers/mtd/devices/spear_smi.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 2cdbcc6..f45dd37 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -563,9 +563,6 @@ static int spear_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
u32 ctrlreg1, val;
int ret;
- if (!len)
- return 0;
-
if (!flash || !dev)
return -ENODEV;
@@ -662,9 +659,6 @@ static int spear_mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
if (!flash || !dev)
return -ENODEV;
- if (!len)
- return 0;
-
if (flash->bank > dev->num_flashes - 1) {
dev_err(&dev->pdev->dev, "Invalid Bank Num");
return -EINVAL;