mirror of https://gitee.com/openkylin/linux.git
mtd: ppchameleonevb: 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
55c0689c08
commit
acd4134ac9
|
@ -73,7 +73,6 @@ __setup("ppchameleon_fio_pbase=", ppchameleon_fio_pbase);
|
||||||
__setup("ppchameleonevb_fio_pbase=", ppchameleonevb_fio_pbase);
|
__setup("ppchameleonevb_fio_pbase=", ppchameleonevb_fio_pbase);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
/*
|
/*
|
||||||
* Define static partitions for flash devices
|
* Define static partitions for flash devices
|
||||||
*/
|
*/
|
||||||
|
@ -101,7 +100,6 @@ static struct mtd_partition partition_info_evb[] = {
|
||||||
#define NUM_PARTITIONS 1
|
#define NUM_PARTITIONS 1
|
||||||
|
|
||||||
extern int parse_cmdline_partitions(struct mtd_info *master, struct mtd_partition **pparts, const char *mtd_id);
|
extern int parse_cmdline_partitions(struct mtd_info *master, struct mtd_partition **pparts, const char *mtd_id);
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* hardware specific access to control-lines
|
* hardware specific access to control-lines
|
||||||
|
@ -189,10 +187,8 @@ static int ppchameleonevb_device_ready(struct mtd_info *minfo)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
const char *part_probes[] = { "cmdlinepart", NULL };
|
const char *part_probes[] = { "cmdlinepart", NULL };
|
||||||
const char *part_probes_evb[] = { "cmdlinepart", NULL };
|
const char *part_probes_evb[] = { "cmdlinepart", NULL };
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Main initialization routine
|
* Main initialization routine
|
||||||
|
@ -284,14 +280,13 @@ static int __init ppchameleonevb_init(void)
|
||||||
this->chip_delay = NAND_SMALL_DELAY_US;
|
this->chip_delay = NAND_SMALL_DELAY_US;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
ppchameleon_mtd->name = "ppchameleon-nand";
|
ppchameleon_mtd->name = "ppchameleon-nand";
|
||||||
mtd_parts_nb = parse_mtd_partitions(ppchameleon_mtd, part_probes, &mtd_parts, 0);
|
mtd_parts_nb = parse_mtd_partitions(ppchameleon_mtd, part_probes, &mtd_parts, 0);
|
||||||
if (mtd_parts_nb > 0)
|
if (mtd_parts_nb > 0)
|
||||||
part_type = "command line";
|
part_type = "command line";
|
||||||
else
|
else
|
||||||
mtd_parts_nb = 0;
|
mtd_parts_nb = 0;
|
||||||
#endif
|
|
||||||
if (mtd_parts_nb == 0) {
|
if (mtd_parts_nb == 0) {
|
||||||
if (ppchameleon_mtd->size == NAND_SMALL_SIZE)
|
if (ppchameleon_mtd->size == NAND_SMALL_SIZE)
|
||||||
mtd_parts = partition_info_me;
|
mtd_parts = partition_info_me;
|
||||||
|
@ -303,7 +298,7 @@ static int __init ppchameleonevb_init(void)
|
||||||
|
|
||||||
/* Register the partitions */
|
/* Register the partitions */
|
||||||
printk(KERN_NOTICE "Using %s partition definition\n", part_type);
|
printk(KERN_NOTICE "Using %s partition definition\n", part_type);
|
||||||
add_mtd_partitions(ppchameleon_mtd, mtd_parts, mtd_parts_nb);
|
mtd_device_register(ppchameleon_mtd, mtd_parts, mtd_parts_nb);
|
||||||
|
|
||||||
nand_evb_init:
|
nand_evb_init:
|
||||||
/****************************
|
/****************************
|
||||||
|
@ -385,14 +380,14 @@ static int __init ppchameleonevb_init(void)
|
||||||
iounmap(ppchameleon_fio_base);
|
iounmap(ppchameleon_fio_base);
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
ppchameleonevb_mtd->name = NAND_EVB_MTD_NAME;
|
ppchameleonevb_mtd->name = NAND_EVB_MTD_NAME;
|
||||||
mtd_parts_nb = parse_mtd_partitions(ppchameleonevb_mtd, part_probes_evb, &mtd_parts, 0);
|
mtd_parts_nb = parse_mtd_partitions(ppchameleonevb_mtd, part_probes_evb, &mtd_parts, 0);
|
||||||
if (mtd_parts_nb > 0)
|
if (mtd_parts_nb > 0)
|
||||||
part_type = "command line";
|
part_type = "command line";
|
||||||
else
|
else
|
||||||
mtd_parts_nb = 0;
|
mtd_parts_nb = 0;
|
||||||
#endif
|
|
||||||
if (mtd_parts_nb == 0) {
|
if (mtd_parts_nb == 0) {
|
||||||
mtd_parts = partition_info_evb;
|
mtd_parts = partition_info_evb;
|
||||||
mtd_parts_nb = NUM_PARTITIONS;
|
mtd_parts_nb = NUM_PARTITIONS;
|
||||||
|
@ -401,7 +396,7 @@ static int __init ppchameleonevb_init(void)
|
||||||
|
|
||||||
/* Register the partitions */
|
/* Register the partitions */
|
||||||
printk(KERN_NOTICE "Using %s partition definition\n", part_type);
|
printk(KERN_NOTICE "Using %s partition definition\n", part_type);
|
||||||
add_mtd_partitions(ppchameleonevb_mtd, mtd_parts, mtd_parts_nb);
|
mtd_device_register(ppchameleonevb_mtd, mtd_parts, mtd_parts_nb);
|
||||||
|
|
||||||
/* Return happy */
|
/* Return happy */
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue