diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-03-06 12:01:08 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-03-20 19:55:17 +0100 |
commit | 17b536cc43bcf2afcc20b4812f93a895881b5f4f (patch) | |
tree | 4f460cf224c26633159eb32ccb90e6b09a9e0658 /drivers/mtd/ar7part.c | |
parent | [MTD] [CHIPS] Add JEDEC probe support for the SST 39VF3201 flash chip (diff) | |
download | linux-17b536cc43bcf2afcc20b4812f93a895881b5f4f.tar.xz linux-17b536cc43bcf2afcc20b4812f93a895881b5f4f.zip |
[MTD] mtdpart: Make all partition parsers return allocated array
Currently redboot and afx parser return allocated mtd_partition array
and cmdlinepart and ar7 return persistent array.
This patch make cmdlinepart and ar7 also return allocated array, so
that all users can free it regardless of parser type.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/ar7part.c')
-rw-r--r-- | drivers/mtd/ar7part.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c index ecf170b55c32..6697a1ec72d0 100644 --- a/drivers/mtd/ar7part.c +++ b/drivers/mtd/ar7part.c @@ -44,8 +44,6 @@ struct ar7_bin_rec { unsigned int address; }; -static struct mtd_partition ar7_parts[AR7_PARTS]; - static int create_mtd_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long origin) @@ -57,7 +55,11 @@ static int create_mtd_partitions(struct mtd_info *master, unsigned int root_offset = ROOT_OFFSET; int retries = 10; + struct mtd_partition *ar7_parts; + ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL); + if (!ar7_parts) + return -ENOMEM; ar7_parts[0].name = "loader"; ar7_parts[0].offset = 0; ar7_parts[0].size = master->erasesize; |