aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorBoris Brezillon2018-12-02 10:54:24 +0100
committerJagan Teki2018-12-06 00:45:36 +0530
commita02820fca90ce9ccf243b3fce59c04dabd5671a8 (patch)
tree1931d8d998ffd0bea9b4719a64a973a71afb2b1b /include/linux
parent779c9c0565a44e7dc5f72919d88f67fb7e280880 (diff)
mtd: Delete partitions attached to the device when a device is deleted
If we don't do that, partitions might still be exposed while the underlying device is gone. Fixes: 2a74930da57f ("mtd: mtdpart: implement proper partition handling") Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Tested-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/mtd.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index d20ebd82028..4d0096d9f1d 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -562,8 +562,23 @@ unsigned mtd_mmap_capabilities(struct mtd_info *mtd);
/* drivers/mtd/mtdcore.h */
int add_mtd_device(struct mtd_info *mtd);
int del_mtd_device(struct mtd_info *mtd);
+
+#ifdef CONFIG_MTD_PARTITIONS
int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
int del_mtd_partitions(struct mtd_info *);
+#else
+static inline int add_mtd_partitions(struct mtd_info *mtd,
+ const struct mtd_partition *parts,
+ int nparts)
+{
+ return 0;
+}
+
+static inline int del_mtd_partitions(struct mtd_info *mtd)
+{
+ return 0;
+}
+#endif
struct mtd_info *__mtd_next_device(int i);
#define mtd_for_each_device(mtd) \