Commit d2d48480d16ab349ae5d4732b4d79ff48b4b4171
Committed by
David Woodhouse
1 parent
596fd46268
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
mtd: move mtd_read_oob() definition out of mtd.h
mtd_read_oob() will be expanded a little, so don't leave it in the header as a static inline function. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Showing 2 changed files with 10 additions and 8 deletions Side-by-side Diff
drivers/mtd/mtdcore.c
... | ... | @@ -858,6 +858,15 @@ |
858 | 858 | } |
859 | 859 | EXPORT_SYMBOL_GPL(mtd_panic_write); |
860 | 860 | |
861 | +int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops) | |
862 | +{ | |
863 | + ops->retlen = ops->oobretlen = 0; | |
864 | + if (!mtd->_read_oob) | |
865 | + return -EOPNOTSUPP; | |
866 | + return mtd->_read_oob(mtd, from, ops); | |
867 | +} | |
868 | +EXPORT_SYMBOL_GPL(mtd_read_oob); | |
869 | + | |
861 | 870 | /* |
862 | 871 | * Method to access the protection register area, present in some flash |
863 | 872 | * devices. The user data is one time programmable but the factory data is read |
include/linux/mtd/mtd.h
... | ... | @@ -265,14 +265,7 @@ |
265 | 265 | int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, |
266 | 266 | const u_char *buf); |
267 | 267 | |
268 | -static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, | |
269 | - struct mtd_oob_ops *ops) | |
270 | -{ | |
271 | - ops->retlen = ops->oobretlen = 0; | |
272 | - if (!mtd->_read_oob) | |
273 | - return -EOPNOTSUPP; | |
274 | - return mtd->_read_oob(mtd, from, ops); | |
275 | -} | |
268 | +int mtd_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops); | |
276 | 269 | |
277 | 270 | static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, |
278 | 271 | struct mtd_oob_ops *ops) |