Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <tim@ipi.ac.ru>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
CC: Greg Ungerer <gerg@uclinux.org>
CC: uclinux-dev@uclinux.org
CC: linux-mtd@lists.infradead.org

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by

Timofei Bondarenko and committed by
David Woodhouse
3ff230a7 9aff1b1a

+8
+8
drivers/mtd/maps/uclinux.c
··· 89 89 mtd->priv = mapp; 90 90 91 91 uclinux_ram_mtdinfo = mtd; 92 + #ifdef CONFIG_MTD_PARTITIONS 92 93 add_mtd_partitions(mtd, uclinux_romfs, NUM_PARTITIONS); 94 + #else 95 + add_mtd_device(mtd); 96 + #endif 93 97 94 98 return(0); 95 99 } ··· 103 99 static void __exit uclinux_mtd_cleanup(void) 104 100 { 105 101 if (uclinux_ram_mtdinfo) { 102 + #ifdef CONFIG_MTD_PARTITIONS 106 103 del_mtd_partitions(uclinux_ram_mtdinfo); 104 + #else 105 + del_mtd_device(uclinux_ram_mtdinfo); 106 + #endif 107 107 map_destroy(uclinux_ram_mtdinfo); 108 108 uclinux_ram_mtdinfo = NULL; 109 109 }