From bcb1d238716d138c9e16347fc32b3c1ae006339e Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 6 Feb 2012 13:27:43 +0200 Subject: 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 Reviewed-by: Shmulik Ladkani Signed-off-by: David Woodhouse --- drivers/mtd/chips/cfi_cmdset_0020.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/mtd/chips/cfi_cmdset_0020.c') diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c index d690b7d..096993f 100644 --- a/drivers/mtd/chips/cfi_cmdset_0020.c +++ b/drivers/mtd/chips/cfi_cmdset_0020.c @@ -615,9 +615,6 @@ static int cfi_staa_write_buffers (struct mtd_info *mtd, loff_t to, int chipnum; unsigned long ofs; - if (!len) - return 0; - chipnum = to >> cfi->chipshift; ofs = to - (chipnum << cfi->chipshift); -- cgit v1.1