[PATCH v2 3/8] ubi: Add getter ubi_volume_get_cdev()

Markus Pargmann mpa at pengutronix.de
Thu Mar 10 00:29:55 PST 2016


cdev is used in a future commit to find the mounted filesystems.

Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
---
 drivers/mtd/ubi/kapi.c  | 5 +++++
 include/linux/mtd/ubi.h | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c
index 7fc1aa8d70cc..c2e58e865753 100644
--- a/drivers/mtd/ubi/kapi.c
+++ b/drivers/mtd/ubi/kapi.c
@@ -308,6 +308,11 @@ void ubi_close_volume(struct ubi_volume_desc *desc)
 }
 EXPORT_SYMBOL_GPL(ubi_close_volume);
 
+struct cdev *ubi_volume_get_cdev(struct ubi_volume_desc *vol)
+{
+	return &vol->vol->cdev;
+}
+
 /**
  * ubi_leb_read - read data.
  * @desc: volume descriptor
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 0614681d731c..0725b04f9dfd 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -218,6 +218,8 @@ int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum);
 int ubi_sync(int ubi_num);
 int ubi_flush(int ubi_num, int vol_id, int lnum);
 
+struct cdev *ubi_volume_get_cdev(struct ubi_volume_desc *vol);
+
 /*
  * This function is the same as the 'ubi_leb_read()' function, but it does not
  * provide the checking capability.
-- 
2.7.0




More information about the barebox mailing list