blob: b5eefeabf310d7cb3780d8559e0ab040e549f91c [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;
David Howells0f071002019-03-25 16:38:31 +00008extern struct backing_dev_info *mtd_bdi;
Ben Hutchingsf1332ba2010-01-29 20:57:11 +00009
Artem Bityutskiycb707832013-03-15 13:02:19 +020010struct mtd_info *__mtd_next_device(int i);
Boris Brezillon2b6f0092019-01-02 15:36:54 +010011int __must_check add_mtd_device(struct mtd_info *mtd);
Artem Bityutskiycb707832013-03-15 13:02:19 +020012int del_mtd_device(struct mtd_info *mtd);
13int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
14int del_mtd_partitions(struct mtd_info *);
Brian Norris07fd2f82015-12-04 15:25:17 -080015
16struct mtd_partitions;
17
Artem Bityutskiycb707832013-03-15 13:02:19 +020018int parse_mtd_partitions(struct mtd_info *master, const char * const *types,
Artem Bityutskiycb707832013-03-15 13:02:19 +020019 struct mtd_part_parser_data *data);
Jamie Ileseea72d52011-05-23 10:23:42 +010020
Brian Norrisadc83bf2015-12-09 10:24:03 -080021void mtd_part_parser_cleanup(struct mtd_partitions *parts);
22
Artem Bityutskiy660685d2013-03-14 13:27:40 +020023int __init init_mtdchar(void);
24void __exit cleanup_mtdchar(void);
25
Ben Hutchingsf1332ba2010-01-29 20:57:11 +000026#define mtd_for_each_device(mtd) \
27 for ((mtd) = __mtd_next_device(0); \
28 (mtd) != NULL; \
29 (mtd) = __mtd_next_device(mtd->index + 1))