Commit 55c0689c08cfd0c596245d64c116794c9ee06a74

Authored by Jamie Iles
Committed by David Woodhouse
1 parent 54e07f5482

mtd: orion_nand: convert to mtd_device_register()

Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

Showing 1 changed file with 1 additions and 13 deletions Side-by-side Diff

drivers/mtd/nand/orion_nand.c
... ... @@ -21,9 +21,7 @@
21 21 #include <mach/hardware.h>
22 22 #include <plat/orion_nand.h>
23 23  
24   -#ifdef CONFIG_MTD_CMDLINE_PARTS
25 24 static const char *part_probes[] = { "cmdlinepart", NULL };
26   -#endif
27 25  
28 26 static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
29 27 {
30 28  
... ... @@ -83,10 +81,8 @@
83 81 struct resource *res;
84 82 void __iomem *io_base;
85 83 int ret = 0;
86   -#ifdef CONFIG_MTD_PARTITIONS
87 84 struct mtd_partition *partitions = NULL;
88 85 int num_part = 0;
89   -#endif
90 86  
91 87 nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL);
92 88 if (!nc) {
... ... @@ -136,7 +132,6 @@
136 132 goto no_dev;
137 133 }
138 134  
139   -#ifdef CONFIG_MTD_PARTITIONS
140 135 #ifdef CONFIG_MTD_CMDLINE_PARTS
141 136 mtd->name = "orion_nand";
142 137 num_part = parse_mtd_partitions(mtd, part_probes, &partitions, 0);
... ... @@ -147,14 +142,7 @@
147 142 partitions = board->parts;
148 143 }
149 144  
150   - if (partitions && num_part > 0)
151   - ret = add_mtd_partitions(mtd, partitions, num_part);
152   - else
153   - ret = add_mtd_device(mtd);
154   -#else
155   - ret = add_mtd_device(mtd);
156   -#endif
157   -
  145 + ret = mtd_device_register(mtd, partitions, num_part);
158 146 if (ret) {
159 147 nand_release(mtd);
160 148 goto no_dev;