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

mtd: samsung onenand: convert to mtd_device_register()

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

Cc: Kyungmin Park <kyungmin.park@samsung.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
6b57c116 ff6e1b26

+3 -9
+3 -9
drivers/mtd/onenand/samsung.c
··· 147 147 struct resource *dma_res; 148 148 unsigned long phys_base; 149 149 struct completion complete; 150 - #ifdef CONFIG_MTD_PARTITIONS 151 150 struct mtd_partition *parts; 152 - #endif 153 151 }; 154 152 155 153 #define CMD_MAP_00(dev, addr) (dev->cmd_map(MAP_00, ((addr) << 1))) ··· 157 159 158 160 static struct s3c_onenand *onenand; 159 161 160 - #ifdef CONFIG_MTD_PARTITIONS 161 162 static const char *part_probes[] = { "cmdlinepart", NULL, }; 162 - #endif 163 163 164 164 static inline int s3c_read_reg(int offset) 165 165 { ··· 1017 1021 if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ) 1018 1022 dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n"); 1019 1023 1020 - #ifdef CONFIG_MTD_PARTITIONS 1021 1024 err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0); 1022 1025 if (err > 0) 1023 - add_mtd_partitions(mtd, onenand->parts, err); 1026 + mtd_device_register(mtd, onenand->parts, err); 1024 1027 else if (err <= 0 && pdata && pdata->parts) 1025 - add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); 1028 + mtd_device_register(mtd, pdata->parts, pdata->nr_parts); 1026 1029 else 1027 - #endif 1028 - err = add_mtd_device(mtd); 1030 + err = mtd_device_register(mtd, NULL, 0); 1029 1031 1030 1032 platform_set_drvdata(pdev, mtd); 1031 1033