summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorArtem Bityutskiy2011-12-29 09:45:04 +0100
committerDavid Woodhouse2012-01-09 19:26:18 +0100
commite2936b2af5562c8c66060e2bc2ae2e209d0acd3d (patch)
tree99af09f8049f9fd76abca6d630ff333b169ab25f /include/linux
parentmtd: mtd->write_user_prot_reg directly (diff)
downloadkernel-qcow2-linux-e2936b2af5562c8c66060e2bc2ae2e209d0acd3d.tar.gz
kernel-qcow2-linux-e2936b2af5562c8c66060e2bc2ae2e209d0acd3d.tar.xz
kernel-qcow2-linux-e2936b2af5562c8c66060e2bc2ae2e209d0acd3d.zip
mtd: do not use mtd->lock_user_prot_reg directly
Instead, check the -EOPNOTSUPP return code of 'mtd_lock_user_prot_reg()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/mtd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 7cd56d2b9419..a994129ede55 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -389,6 +389,8 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to,
static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
size_t len)
{
+ if (!mtd->lock_user_prot_reg)
+ return -EOPNOTSUPP;
return mtd->lock_user_prot_reg(mtd, from, len);
}