[PATCH] mtd: add documentation about locking context of MTD API
Robert Jarzmik
robert.jarzmik at free.fr
Mon Mar 19 18:26:25 EDT 2012
Add a comment to mtd header for MTD drivers writters, so that they
know that each function in the MTD API, ie. in the mtd_info
structure, is called in a sleeping context.
Signed-off-by: Robert Jarzmik <robert.jarzmik at free.fr>
---
include/linux/mtd/mtd.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index cf5ea8c..4a417e7 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -176,6 +176,11 @@ struct mtd_info {
/*
* Do not call via these pointers, use corresponding mtd_*()
* wrappers instead.
+ *
+ * All the following functions are called in a sleeping context, ie. it
+ * can be safely assumed in mtd drivers that :
+ * - might_sleep() == 1
+ * - msleep(), mutex_lock() and co are authorized
*/
int (*_erase) (struct mtd_info *mtd, struct erase_info *instr);
int (*_point) (struct mtd_info *mtd, loff_t from, size_t len,
--
1.7.5.4
More information about the linux-mtd
mailing list