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

mtd: pxa: convert to mtd_device_register()

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

Cc: Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
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>

authored by

Jamie Iles and committed by
David Woodhouse
3dfad123 6cbbf2ff

+7 -26
-1
arch/arm/mach-pxa/Kconfig
··· 153 153 bool "Iskratel Electronics XCEP" 154 154 select PXA25x 155 155 select MTD 156 - select MTD_PARTITIONS 157 156 select MTD_PHYSMAP 158 157 select MTD_CFI_INTELEXT 159 158 select MTD_CFI
-1
drivers/mtd/maps/Kconfig
··· 161 161 config MTD_PXA2XX 162 162 tristate "CFI Flash device mapped on Intel XScale PXA2xx based boards" 163 163 depends on (PXA25x || PXA27x) && MTD_CFI_INTELEXT 164 - select MTD_PARTITIONS 165 164 help 166 165 This provides a driver for the NOR flash attached to a PXA2xx chip. 167 166
+4 -14
drivers/mtd/maps/pxa2xx-flash.c
··· 104 104 } 105 105 info->mtd->owner = THIS_MODULE; 106 106 107 - #ifdef CONFIG_MTD_PARTITIONS 108 107 ret = parse_mtd_partitions(info->mtd, probes, &parts, 0); 109 108 110 109 if (ret > 0) { 111 110 info->nr_parts = ret; 112 111 info->parts = parts; 113 112 } 114 - #endif 115 113 116 - if (info->nr_parts) { 117 - add_mtd_partitions(info->mtd, info->parts, 118 - info->nr_parts); 119 - } else { 114 + if (!info->nr_parts) 120 115 printk("Registering %s as whole device\n", 121 116 info->map.name); 122 - add_mtd_device(info->mtd); 123 - } 117 + 118 + mtd_device_register(info->mtd, info->parts, info->nr_parts); 124 119 125 120 platform_set_drvdata(pdev, info); 126 121 return 0; ··· 127 132 128 133 platform_set_drvdata(dev, NULL); 129 134 130 - #ifdef CONFIG_MTD_PARTITIONS 131 - if (info->nr_parts) 132 - del_mtd_partitions(info->mtd); 133 - else 134 - #endif 135 - del_mtd_device(info->mtd); 135 + mtd_device_unregister(info->mtd); 136 136 137 137 map_destroy(info->mtd); 138 138 iounmap(info->map.virt);
+3 -10
drivers/mtd/nand/pxa3xx_nand.c
··· 1119 1119 clk_put(info->clk); 1120 1120 1121 1121 if (mtd) { 1122 - del_mtd_device(mtd); 1123 - #ifdef CONFIG_MTD_PARTITIONS 1124 - del_mtd_partitions(mtd); 1125 - #endif 1122 + mtd_device_unregister(mtd); 1126 1123 kfree(mtd); 1127 1124 } 1128 1125 return 0; ··· 1146 1149 return -ENODEV; 1147 1150 } 1148 1151 1149 - #ifdef CONFIG_MTD_PARTITIONS 1150 1152 if (mtd_has_cmdlinepart()) { 1151 1153 const char *probes[] = { "cmdlinepart", NULL }; 1152 1154 struct mtd_partition *parts; ··· 1154 1158 nr_parts = parse_mtd_partitions(info->mtd, probes, &parts, 0); 1155 1159 1156 1160 if (nr_parts) 1157 - return add_mtd_partitions(info->mtd, parts, nr_parts); 1161 + return mtd_device_register(info->mtd, parts, nr_parts); 1158 1162 } 1159 1163 1160 - return add_mtd_partitions(info->mtd, pdata->parts, pdata->nr_parts); 1161 - #else 1162 - return 0; 1163 - #endif 1164 + return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts); 1164 1165 } 1165 1166 1166 1167 #ifdef CONFIG_PM