Commit 6b57c11601c8fa4bfa046513c4df155b3b58ea89
Committed by
David Woodhouse
1 parent
ff6e1b26d5
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 3 additions and 9 deletions Side-by-side Diff
drivers/mtd/onenand/samsung.c
... | ... | @@ -147,9 +147,7 @@ |
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))) |
156 | 154 | |
... | ... | @@ -159,9 +157,7 @@ |
159 | 157 | |
160 | 158 | static struct s3c_onenand *onenand; |
161 | 159 | |
162 | -#ifdef CONFIG_MTD_PARTITIONS | |
163 | 160 | static const char *part_probes[] = { "cmdlinepart", NULL, }; |
164 | -#endif | |
165 | 161 | |
166 | 162 | static inline int s3c_read_reg(int offset) |
167 | 163 | { |
168 | 164 | |
169 | 165 | |
170 | 166 | |
... | ... | @@ -1021,15 +1017,13 @@ |
1021 | 1017 | if (s3c_read_reg(MEM_CFG_OFFSET) & ONENAND_SYS_CFG1_SYNC_READ) |
1022 | 1018 | dev_info(&onenand->pdev->dev, "OneNAND Sync. Burst Read enabled\n"); |
1023 | 1019 | |
1024 | -#ifdef CONFIG_MTD_PARTITIONS | |
1025 | 1020 | err = parse_mtd_partitions(mtd, part_probes, &onenand->parts, 0); |
1026 | 1021 | if (err > 0) |
1027 | - add_mtd_partitions(mtd, onenand->parts, err); | |
1022 | + mtd_device_register(mtd, onenand->parts, err); | |
1028 | 1023 | else if (err <= 0 && pdata && pdata->parts) |
1029 | - add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); | |
1024 | + mtd_device_register(mtd, pdata->parts, pdata->nr_parts); | |
1030 | 1025 | else |
1031 | -#endif | |
1032 | - err = add_mtd_device(mtd); | |
1026 | + err = mtd_device_register(mtd, NULL, 0); | |
1033 | 1027 | |
1034 | 1028 | platform_set_drvdata(pdev, mtd); |
1035 | 1029 |