diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-02-06 12:27:43 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-03-27 01:32:19 +0200 |
commit | bcb1d238716d138c9e16347fc32b3c1ae006339e (patch) | |
tree | ccb7a9aea7b77481fa3474124218521e0c32de82 /drivers/mtd/devices/block2mtd.c | |
parent | mtd: harmonize mtd_point interface implementation (diff) | |
download | linux-bcb1d238716d138c9e16347fc32b3c1ae006339e.tar.xz linux-bcb1d238716d138c9e16347fc32b3c1ae006339e.zip |
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/block2mtd.c')
-rw-r--r-- | drivers/mtd/devices/block2mtd.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c index ba2d74b01c7e..a4a80b742e65 100644 --- a/drivers/mtd/devices/block2mtd.c +++ b/drivers/mtd/devices/block2mtd.c @@ -178,9 +178,6 @@ static int block2mtd_write(struct mtd_info *mtd, loff_t to, size_t len, struct block2mtd_dev *dev = mtd->priv; int err; - if (!len) - return 0; - mutex_lock(&dev->write_mutex); err = _block2mtd_write(dev, buf, to, len, retlen); mutex_unlock(&dev->write_mutex); |