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>
This commit is contained in:
committed by
David Woodhouse
parent
87e858a97e
commit
b6de3d6cb6
@@ -352,6 +352,8 @@ static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
|
||||
u_char *buf)
|
||||
{
|
||||
*retlen = 0;
|
||||
if (!mtd->read_fact_prot_reg)
|
||||
return -EOPNOTSUPP;
|
||||
return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf);
|
||||
}
|
||||
|
||||
@@ -369,6 +371,8 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
|
||||
u_char *buf)
|
||||
{
|
||||
*retlen = 0;
|
||||
if (!mtd->read_user_prot_reg)
|
||||
return -EOPNOTSUPP;
|
||||
return mtd->read_user_prot_reg(mtd, from, len, retlen, buf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user