summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <dedekind@infradead.org>2006-10-11 14:52:45 +0300
committerArtem Bityutskiy <dedekind@infradead.org>2006-11-29 17:04:53 +0200
commit9fe912cea32aec18f860c95e8574410b5892481b (patch)
tree3efcd1c31f2af29b4357164d5891cfdbe6f3e052 /include/linux/mtd
parent7799308f34d3c3371a319559687c78c0f2506fcf (diff)
downloadblackbird-op-linux-9fe912cea32aec18f860c95e8574410b5892481b.tar.gz
blackbird-op-linux-9fe912cea32aec18f860c95e8574410b5892481b.zip
[MTD] add get and put methods
This patch adds get_device() and put_device() methods to the MTD description structure (struct mtd_info). These methods are called by MTD whenever the MTD device is get or put. They are needed when the underlying driver is something smarter then just flash chip driver, for example UBI. Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/mtd.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 89e937dfef55..d644e57703ad 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -207,6 +207,13 @@ struct mtd_info {
struct module *owner;
int usecount;
+
+ /* If the driver is something smart, like UBI, it may need to maintain
+ * its own reference counting. The below functions are only for driver.
+ * The driver may register its callbacks. These callbacks are not
+ * supposed to be called by MTD users */
+ int (*get_device) (struct mtd_info *mtd);
+ void (*put_device) (struct mtd_info *mtd);
};
OpenPOWER on IntegriCloud