blob: 9887bda317cd9daabe4de8515587e5a11803a431 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Artem Bityutskiycb707832013-03-15 13:02:19 +02002/*
Artem Bityutskiy660685d2013-03-14 13:27:40 +02003 * These are exported solely for the purpose of mtd_blkdevs.c and mtdchar.c.
4 * You should not use them for _anything_ else.
Ben Dooks356d70f2007-05-28 20:28:34 +01005 */
6
Ben Dooks356d70f2007-05-28 20:28:34 +01007extern struct mutex mtd_table_mutex;
Ben Hutchingsf1332ba2010-01-29 20:57:11 +00008
Artem Bityutskiycb707832013-03-15 13:02:19 +02009struct mtd_info *__mtd_next_device(int i);
10int add_mtd_device(struct mtd_info *mtd);
11int del_mtd_device(struct mtd_info *mtd);
12int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
13int del_mtd_partitions(struct mtd_info *);
Brian Norris07fd2f82015-12-04 15:25:17 -080014
15struct mtd_partitions;
16
Artem Bityutskiycb707832013-03-15 13:02:19 +020017int parse_mtd_partitions(struct mtd_info *master, const char * const *types,
Artem Bityutskiycb707832013-03-15 13:02:19 +020018 struct mtd_part_parser_data *data);
Jamie Ileseea72d52011-05-23 10:23:42 +010019
Brian Norrisadc83bf2015-12-09 10:24:03 -080020void mtd_part_parser_cleanup(struct mtd_partitions *parts);
21
Artem Bityutskiy660685d2013-03-14 13:27:40 +020022int __init init_mtdchar(void);
23void __exit cleanup_mtdchar(void);
24
Ben Hutchingsf1332ba2010-01-29 20:57:11 +000025#define mtd_for_each_device(mtd) \
26 for ((mtd) = __mtd_next_device(0); \
27 (mtd) != NULL; \
28 (mtd) = __mtd_next_device(mtd->index + 1))