diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:23:34 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:23:53 -0400 |
commit | 6baed700f21c9b200e344518932a7046b05853a4 (patch) | |
tree | 9ec326c6cba62c88b2a0f6114e5a884a56476f51 | |
parent | af86ea8fa3df5516175ec948875f6e742e82c1ad (diff) |
mtd: sharpsl: convert to mtd_device_register()
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.
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>
-rw-r--r-- | drivers/mtd/nand/sharpsl.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 54ec7542a7b7..19e24ed089ea 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -103,9 +103,7 @@ static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat, | |||
103 | return readb(sharpsl->io + ECCCNTR) != 0; | 103 | return readb(sharpsl->io + ECCCNTR) != 0; |
104 | } | 104 | } |
105 | 105 | ||
106 | #ifdef CONFIG_MTD_PARTITIONS | ||
107 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 106 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
108 | #endif | ||
109 | 107 | ||
110 | /* | 108 | /* |
111 | * Main initialization routine | 109 | * Main initialization routine |
@@ -113,10 +111,8 @@ static const char *part_probes[] = { "cmdlinepart", NULL }; | |||
113 | static int __devinit sharpsl_nand_probe(struct platform_device *pdev) | 111 | static int __devinit sharpsl_nand_probe(struct platform_device *pdev) |
114 | { | 112 | { |
115 | struct nand_chip *this; | 113 | struct nand_chip *this; |
116 | #ifdef CONFIG_MTD_PARTITIONS | ||
117 | struct mtd_partition *sharpsl_partition_info; | 114 | struct mtd_partition *sharpsl_partition_info; |
118 | int nr_partitions; | 115 | int nr_partitions; |
119 | #endif | ||
120 | struct resource *r; | 116 | struct resource *r; |
121 | int err = 0; | 117 | int err = 0; |
122 | struct sharpsl_nand *sharpsl; | 118 | struct sharpsl_nand *sharpsl; |
@@ -188,18 +184,14 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev) | |||
188 | 184 | ||
189 | /* Register the partitions */ | 185 | /* Register the partitions */ |
190 | sharpsl->mtd.name = "sharpsl-nand"; | 186 | sharpsl->mtd.name = "sharpsl-nand"; |
191 | #ifdef CONFIG_MTD_PARTITIONS | ||
192 | nr_partitions = parse_mtd_partitions(&sharpsl->mtd, part_probes, &sharpsl_partition_info, 0); | 187 | nr_partitions = parse_mtd_partitions(&sharpsl->mtd, part_probes, &sharpsl_partition_info, 0); |
193 | if (nr_partitions <= 0) { | 188 | if (nr_partitions <= 0) { |
194 | nr_partitions = data->nr_partitions; | 189 | nr_partitions = data->nr_partitions; |
195 | sharpsl_partition_info = data->partitions; | 190 | sharpsl_partition_info = data->partitions; |
196 | } | 191 | } |
197 | 192 | ||
198 | if (nr_partitions > 0) | 193 | err = mtd_device_register(&sharpsl->mtd, sharpsl_partition_info, |
199 | err = add_mtd_partitions(&sharpsl->mtd, sharpsl_partition_info, nr_partitions); | 194 | nr_partitions); |
200 | else | ||
201 | #endif | ||
202 | err = add_mtd_device(&sharpsl->mtd); | ||
203 | if (err) | 195 | if (err) |
204 | goto err_add; | 196 | goto err_add; |
205 | 197 | ||