Commit 55c0689c authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse

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: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 54e07f54
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <plat/orion_nand.h> #include <plat/orion_nand.h>
#ifdef CONFIG_MTD_CMDLINE_PARTS
static const char *part_probes[] = { "cmdlinepart", NULL }; static const char *part_probes[] = { "cmdlinepart", NULL };
#endif
static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{ {
...@@ -83,10 +81,8 @@ static int __init orion_nand_probe(struct platform_device *pdev) ...@@ -83,10 +81,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
void __iomem *io_base; void __iomem *io_base;
int ret = 0; int ret = 0;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *partitions = NULL; struct mtd_partition *partitions = NULL;
int num_part = 0; int num_part = 0;
#endif
nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL); nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL);
if (!nc) { if (!nc) {
...@@ -136,7 +132,6 @@ static int __init orion_nand_probe(struct platform_device *pdev) ...@@ -136,7 +132,6 @@ static int __init orion_nand_probe(struct platform_device *pdev)
goto no_dev; goto no_dev;
} }
#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_CMDLINE_PARTS #ifdef CONFIG_MTD_CMDLINE_PARTS
mtd->name = "orion_nand"; mtd->name = "orion_nand";
num_part = parse_mtd_partitions(mtd, part_probes, &partitions, 0); num_part = parse_mtd_partitions(mtd, part_probes, &partitions, 0);
...@@ -147,14 +142,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) ...@@ -147,14 +142,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
partitions = board->parts; partitions = board->parts;
} }
if (partitions && num_part > 0) ret = mtd_device_register(mtd, partitions, num_part);
ret = add_mtd_partitions(mtd, partitions, num_part);
else
ret = add_mtd_device(mtd);
#else
ret = add_mtd_device(mtd);
#endif
if (ret) { if (ret) {
nand_release(mtd); nand_release(mtd);
goto no_dev; goto no_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment