diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-28 10:27:18 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:26:13 -0500 |
commit | 016c1291ce70a22f15f666441a4fd2f0b450375b (patch) | |
tree | 650a0d91aa87bcf6146f98eadf0341d46ce0ef0f /include/linux/mtd/mtd.h | |
parent | 4991e7251ed951a5f33faf25912e9db416306309 (diff) |
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>
Diffstat (limited to 'include/linux/mtd/mtd.h')
-rw-r--r-- | include/linux/mtd/mtd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 2c2a92247e5..b72964049cd 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -311,6 +311,8 @@ static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
311 | size_t *retlen, const u_char *buf) | 311 | size_t *retlen, const u_char *buf) |
312 | { | 312 | { |
313 | *retlen = 0; | 313 | *retlen = 0; |
314 | if (!mtd->panic_write) | ||
315 | return -EOPNOTSUPP; | ||
314 | return mtd->panic_write(mtd, to, len, retlen, buf); | 316 | return mtd->panic_write(mtd, to, len, retlen, buf); |
315 | } | 317 | } |
316 | 318 | ||