aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/mtd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 8ae37e9d45de..a09077aca45b 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -258,6 +258,7 @@ static inline int mtd_erase(struct mtd_info *mtd, struct erase_info *instr)
258static inline int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, 258static inline int mtd_point(struct mtd_info *mtd, loff_t from, size_t len,
259 size_t *retlen, void **virt, resource_size_t *phys) 259 size_t *retlen, void **virt, resource_size_t *phys)
260{ 260{
261 *retlen = 0;
261 return mtd->point(mtd, from, len, retlen, virt, phys); 262 return mtd->point(mtd, from, len, retlen, virt, phys);
262} 263}
263 264
@@ -289,6 +290,7 @@ static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
289static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, 290static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
290 size_t *retlen, const u_char *buf) 291 size_t *retlen, const u_char *buf)
291{ 292{
293 *retlen = 0;
292 return mtd->write(mtd, to, len, retlen, buf); 294 return mtd->write(mtd, to, len, retlen, buf);
293} 295}
294 296
@@ -302,18 +304,21 @@ static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
302static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, 304static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
303 size_t *retlen, const u_char *buf) 305 size_t *retlen, const u_char *buf)
304{ 306{
307 *retlen = 0;
305 return mtd->panic_write(mtd, to, len, retlen, buf); 308 return mtd->panic_write(mtd, to, len, retlen, buf);
306} 309}
307 310
308static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, 311static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from,
309 struct mtd_oob_ops *ops) 312 struct mtd_oob_ops *ops)
310{ 313{
314 ops->retlen = ops->oobretlen = 0;
311 return mtd->read_oob(mtd, from, ops); 315 return mtd->read_oob(mtd, from, ops);
312} 316}
313 317
314static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, 318static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
315 struct mtd_oob_ops *ops) 319 struct mtd_oob_ops *ops)
316{ 320{
321 ops->retlen = ops->oobretlen = 0;
317 return mtd->write_oob(mtd, to, ops); 322 return mtd->write_oob(mtd, to, ops);
318} 323}
319 324
@@ -332,6 +337,7 @@ static inline int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
332 size_t len, size_t *retlen, 337 size_t len, size_t *retlen,
333 u_char *buf) 338 u_char *buf)
334{ 339{
340 *retlen = 0;
335 return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf); 341 return mtd->read_fact_prot_reg(mtd, from, len, retlen, buf);
336} 342}
337 343
@@ -346,6 +352,7 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
346 size_t len, size_t *retlen, 352 size_t len, size_t *retlen,
347 u_char *buf) 353 u_char *buf)
348{ 354{
355 *retlen = 0;
349 return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); 356 return mtd->read_user_prot_reg(mtd, from, len, retlen, buf);
350} 357}
351 358
@@ -353,6 +360,7 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to,
353 size_t len, size_t *retlen, 360 size_t len, size_t *retlen,
354 u_char *buf) 361 u_char *buf)
355{ 362{
363 *retlen = 0;
356 return mtd->write_user_prot_reg(mtd, to, len, retlen, buf); 364 return mtd->write_user_prot_reg(mtd, to, len, retlen, buf);
357} 365}
358 366
@@ -369,6 +377,7 @@ static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
369static inline int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, 377static inline int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
370 unsigned long count, loff_t to, size_t *retlen) 378 unsigned long count, loff_t to, size_t *retlen)
371{ 379{
380 *retlen = 0;
372 return mtd->writev(mtd, vecs, count, to, retlen); 381 return mtd->writev(mtd, vecs, count, to, retlen);
373} 382}
374 383