]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: check for zero length in OTP functions
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 8 Feb 2012 14:37:14 +0000 (16:37 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:32:29 +0000 (00:32 +0100)
commit29d37f9c7df9a2952d297777aa9f599f14901d4b
tree4775c9b137c10bdd9b9ed51651e8ff281987f727
parent5029c780b7bc1282b647db9c35ae0124b3d42e80
mtd: check for zero length in OTP functions

This patch changes all the OTP functions like 'mtd_get_fact_prot_info()' and
makes them return zero immediately if the input 'len' parameter is 0. This is
not really needed currently, but most of the other functions do this, and it is
just consistent to do the same in the OTP functions.

This patch also moves the OTP functions from the header file to mtdcore.c
because they become a bit too big for being inlined.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdcore.c
include/linux/mtd/mtd.h