mtd: dc21285: 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>
This commit is contained in:
parent
98b3979b92
commit
bc2ffddc46
1 changed files with 3 additions and 17 deletions
|
@ -145,17 +145,13 @@ static struct map_info dc21285_map = {
|
||||||
|
|
||||||
|
|
||||||
/* Partition stuff */
|
/* Partition stuff */
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
static struct mtd_partition *dc21285_parts;
|
static struct mtd_partition *dc21285_parts;
|
||||||
static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
|
static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
|
||||||
#endif
|
|
||||||
|
|
||||||
static int __init init_dc21285(void)
|
static int __init init_dc21285(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
int nrparts;
|
int nrparts;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Determine bankwidth */
|
/* Determine bankwidth */
|
||||||
switch (*CSR_SA110_CNTL & (3<<14)) {
|
switch (*CSR_SA110_CNTL & (3<<14)) {
|
||||||
|
@ -204,13 +200,8 @@ static int __init init_dc21285(void)
|
||||||
|
|
||||||
dc21285_mtd->owner = THIS_MODULE;
|
dc21285_mtd->owner = THIS_MODULE;
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, 0);
|
nrparts = parse_mtd_partitions(dc21285_mtd, probes, &dc21285_parts, 0);
|
||||||
if (nrparts > 0)
|
mtd_device_register(dc21285_mtd, dc21285_parts, nrparts);
|
||||||
add_mtd_partitions(dc21285_mtd, dc21285_parts, nrparts);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
add_mtd_device(dc21285_mtd);
|
|
||||||
|
|
||||||
if(machine_is_ebsa285()) {
|
if(machine_is_ebsa285()) {
|
||||||
/*
|
/*
|
||||||
|
@ -232,14 +223,9 @@ static int __init init_dc21285(void)
|
||||||
|
|
||||||
static void __exit cleanup_dc21285(void)
|
static void __exit cleanup_dc21285(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
mtd_device_unregister(dc21285_mtd);
|
||||||
if (dc21285_parts) {
|
if (dc21285_parts)
|
||||||
del_mtd_partitions(dc21285_mtd);
|
|
||||||
kfree(dc21285_parts);
|
kfree(dc21285_parts);
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
del_mtd_device(dc21285_mtd);
|
|
||||||
|
|
||||||
map_destroy(dc21285_mtd);
|
map_destroy(dc21285_mtd);
|
||||||
iounmap(dc21285_map.virt);
|
iounmap(dc21285_map.virt);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue