diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-06-10 10:18:28 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:10 -0400 |
commit | c7975330154af17aecc167b33ca866b6b3d98918 (patch) | |
tree | b9895816b3f9bd53758410754ad1b1061986a8dd /include/linux/mtd/partitions.h | |
parent | f722013ee9fd24623df31dec9a91a6d02c3e2f2f (diff) |
mtd: abstract last MTD partition parser argument
Encapsulate last MTD partition parser argument into a separate
structure. Currently it holds only 'origin' field for RedBoot parser,
but will be extended in future to contain at least device_node for OF
devices.
Amended commentary to make kerneldoc happy
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'include/linux/mtd/partitions.h')
-rw-r--r-- | include/linux/mtd/partitions.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 1431cf2609ed..5fdb963a5035 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -52,6 +52,15 @@ struct mtd_partition { | |||
52 | 52 | ||
53 | struct mtd_info; | 53 | struct mtd_info; |
54 | 54 | ||
55 | /** | ||
56 | * struct mtd_part_parser_data - used to pass data to MTD partition parsers. | ||
57 | * @origin: for RedBoot, start address of MTD device | ||
58 | */ | ||
59 | struct mtd_part_parser_data { | ||
60 | unsigned long origin; | ||
61 | }; | ||
62 | |||
63 | |||
55 | /* | 64 | /* |
56 | * Functions dealing with the various ways of partitioning the space | 65 | * Functions dealing with the various ways of partitioning the space |
57 | */ | 66 | */ |
@@ -60,13 +69,15 @@ struct mtd_part_parser { | |||
60 | struct list_head list; | 69 | struct list_head list; |
61 | struct module *owner; | 70 | struct module *owner; |
62 | const char *name; | 71 | const char *name; |
63 | int (*parse_fn)(struct mtd_info *, struct mtd_partition **, unsigned long); | 72 | int (*parse_fn)(struct mtd_info *, struct mtd_partition **, |
73 | struct mtd_part_parser_data *); | ||
64 | }; | 74 | }; |
65 | 75 | ||
66 | extern int register_mtd_parser(struct mtd_part_parser *parser); | 76 | extern int register_mtd_parser(struct mtd_part_parser *parser); |
67 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); | 77 | extern int deregister_mtd_parser(struct mtd_part_parser *parser); |
68 | extern int parse_mtd_partitions(struct mtd_info *master, const char **types, | 78 | extern int parse_mtd_partitions(struct mtd_info *master, const char **types, |
69 | struct mtd_partition **pparts, unsigned long origin); | 79 | struct mtd_partition **pparts, |
80 | struct mtd_part_parser_data *data); | ||
70 | 81 | ||
71 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) | 82 | #define put_partition_parser(p) do { module_put((p)->owner); } while(0) |
72 | 83 | ||