aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-29 03:06:32 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:16 -0500
commitb6de3d6cb63427178c4f1df88b81d1ceee637e6f (patch)
tree9e84f24ac14305246c6f38e885edbc9f48dfc089 /include/linux/mtd
parent87e858a97e8a7010aedc01db7cd31cc7c02b0b6a (diff)
mtd: do not use mtd->read_*_prot_reg directly
Instead, call 'mtd_read_*_prot_info()' and check for -EOPNOTSUPP. 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 7122efdc6d99..e488cf910914 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -352,6 +352,8 @@ static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
352 u_char *buf) 352 u_char *buf)
353{ 353{
354 *retlen = 0; 354 *retlen = 0;
355 if (!mtd->read_fact_prot_reg)
356 return -EOPNOTSUPP;
355 return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf); 357 return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf);
356} 358}
357 359
@@ -369,6 +371,8 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
369 u_char *buf) 371 u_char *buf)
370{ 372{
371 *retlen = 0; 373 *retlen = 0;
374 if (!mtd->read_user_prot_reg)
375 return -EOPNOTSUPP;
372 return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); 376 return mtd->read_user_prot_reg(mtd, from, len, retlen, buf);
373} 377}
374 378