summaryrefslogtreecommitdiff
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-29 12:39:20 +0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 22:26:17 +0400
commit27c151a5e52efaa46d0938984f2ef591bdcb6d5b (patch)
tree67866c01422a4f0c99192b0bc2db8f1968cd1f5b /include/linux/mtd
parentb6de3d6cb63427178c4f1df88b81d1ceee637e6f (diff)
downloadlinux-27c151a5e52efaa46d0938984f2ef591bdcb6d5b.tar.xz
mtd: mtd->write_user_prot_reg directly
Instead, just call 'mtd_write_user_prot_reg()' and check the '-EOPNOTSUPP' return code. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd')
-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 e488cf910914..7cd56d2b9419 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -381,6 +381,8 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to,
u_char *buf)
{
*retlen = 0;
+ if (!mtd->write_user_prot_reg)
+ return -EOPNOTSUPP;
return mtd->write_user_prot_reg(mtd, to, len, retlen, buf);
}