mtd: mtdoops: do not use mtd->panic_write directly
Instead of checking if 'mtd->panic_write' is defined, call 'mtd_panic_write()' and check the error code - '-EOPNOTSUPP' will be returned if the function is not defined. 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
4991e7251e
commit
016c1291ce
@ -311,6 +311,8 @@ static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
|
||||
size_t *retlen, const u_char *buf)
|
||||
{
|
||||
*retlen = 0;
|
||||
if (!mtd->panic_write)
|
||||
return -EOPNOTSUPP;
|
||||
return mtd->panic_write(mtd, to, len, retlen, buf);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user