mtd: do not use mtd->get_*_prot_info directly
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 28 Dec 2011 16:47:46 +0000 (18:47 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 9 Jan 2012 18:26:15 +0000 (18:26 +0000)
commit87e858a97e8a7010aedc01db7cd31cc7c02b0b6a
treec5ff8b86ef0ae7891224e620916c58241c3e1799
parentdac2639f9833e858139d7e07f6ee45fb2191a9f2
mtd: do not use mtd->get_*_prot_info directly

Instead, call 'mtd_get_*_prot_info()' and check for '-EOPNOTSUPP'. While
on it, fix the return code from '-EOPNOTSUPP' to '-EINVAL' for the case
when the mode parameter is invalid.

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