public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: add documentation about locking context of MTD API
@ 2012-03-19 22:26 Robert Jarzmik
  2012-03-19 22:31 ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Jarzmik @ 2012-03-19 22:26 UTC (permalink / raw)
  To: linux-mtd; +Cc: Robert Jarzmik

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@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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-22  9:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 22:26 [PATCH] mtd: add documentation about locking context of MTD API Robert Jarzmik
2012-03-19 22:31 ` Richard Weinberger
2012-03-19 22:51   ` Robert Jarzmik
2012-03-20 11:44     ` Artem Bityutskiy
2012-03-21 20:20       ` Robert Jarzmik
2012-03-22  9:37         ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox