aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ar7part.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ar7part.c')
-rw-r--r--drivers/mtd/ar7part.c6
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 {
44 unsigned int address; 44 unsigned int address;
45}; 45};
46 46
47static struct mtd_partition ar7_parts[AR7_PARTS];
48
49static int create_mtd_partitions(struct mtd_info *master, 47static int create_mtd_partitions(struct mtd_info *master,
50 struct mtd_partition **pparts, 48 struct mtd_partition **pparts,
51 unsigned long origin) 49 unsigned long origin)
@@ -57,7 +55,11 @@ static int create_mtd_partitions(struct mtd_info *master,
57 unsigned int root_offset = ROOT_OFFSET; 55 unsigned int root_offset = ROOT_OFFSET;
58 56
59 int retries = 10; 57 int retries = 10;
58 struct mtd_partition *ar7_parts;
60 59
60 ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL);
61 if (!ar7_parts)
62 return -ENOMEM;
61 ar7_parts[0].name = "loader"; 63 ar7_parts[0].name = "loader";
62 ar7_parts[0].offset = 0; 64 ar7_parts[0].offset = 0;
63 ar7_parts[0].size = master->erasesize; 65 ar7_parts[0].size = master->erasesize;