mtd/maps: uclinux: fix building when partition support is disabled

The uClinux map driver doesn't even use partitions, so we shouldn't require
it in order to work properly.

Signed-off-by: Timofei Bondarenko <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
Signed-off-by: Sonic Zhang <[email protected]>
CC: Greg Ungerer <[email protected]>
CC: [email protected]
CC: [email protected]

Signed-off-by: David Woodhouse <[email protected]>
This commit is contained in:
Timofei Bondarenko 2009-05-20 19:59:02 -04:00 • committed by David Woodhouse
commit 3ff230a742

View file

@ -89,7 +89,11 @@ static int __init uclinux_mtd_init(void)
mtd->priv = mapp;
uclinux_ram_mtdinfo = mtd;
#ifdef CONFIG_MTD_PARTITIONS
add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS);
#else
add_mtd_device(mtd);
#endif
return(0);
}
@ -99,7 +103,11 @@ static int __init uclinux_mtd_init(void)
static void __exit uclinux_mtd_cleanup(void)
{
if (uclinux_ram_mtdinfo) {
#ifdef CONFIG_MTD_PARTITIONS
del_mtd_partitions(uclinux_ram_mtdinfo);
#else
del_mtd_device(uclinux_ram_mtdinfo);
#endif
map_destroy(uclinux_ram_mtdinfo);
uclinux_ram_mtdinfo = NULL;
}