@@ -614,7 +614,7 @@ int __get_mtd_device(struct mtd_info *mtd)
return -ENODEV;
if (mtd->get_device) {
- err = mtd->get_device(mtd);
+ err = mtd_get_device(mtd);
if (err) {
module_put(mtd->owner);
@@ -214,6 +214,7 @@ struct mtd_info {
int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
int (*suspend) (struct mtd_info *mtd);
void (*resume) (struct mtd_info *mtd);
+ int (*get_device) (struct mtd_info *mtd);
/* Backing device capabilities for this device
* - provides mmap capabilities
@@ -237,7 +238,6 @@ struct mtd_info {
* 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);
};
@@ -414,6 +414,11 @@ static inline int mtd_block_markbad(struct mtd_info *mtd, loff_t ofs)
return mtd->block_markbad(mtd, ofs);
}
+static inline int mtd_get_device(struct mtd_info *mtd)
+{
+ return mtd->get_device(mtd);
+}
+
static inline struct mtd_info *dev_to_mtd(struct device *dev)
{
return dev ? dev_get_drvdata(dev) : NULL;