mtd: bfin: convert to mtd_device_register()
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS preprocessor conditionals as partitioning is always available. Cc: Mike Frysinger <vapier@gentoo.org> 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:
Родитель
78352282f3
Коммит
fee88c58c7
|
@ -381,7 +381,6 @@ static struct platform_device net2272_bfin_device = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
|
#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
|
const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
|
||||||
|
|
||||||
static struct mtd_partition bfin_plat_nand_partitions[] = {
|
static struct mtd_partition bfin_plat_nand_partitions[] = {
|
||||||
|
@ -395,7 +394,6 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {
|
||||||
.offset = MTDPART_OFS_APPEND,
|
.offset = MTDPART_OFS_APPEND,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BFIN_NAND_PLAT_CLE 2
|
#define BFIN_NAND_PLAT_CLE 2
|
||||||
#define BFIN_NAND_PLAT_ALE 1
|
#define BFIN_NAND_PLAT_ALE 1
|
||||||
|
@ -422,11 +420,9 @@ static struct platform_nand_data bfin_plat_nand_data = {
|
||||||
.chip = {
|
.chip = {
|
||||||
.nr_chips = 1,
|
.nr_chips = 1,
|
||||||
.chip_delay = 30,
|
.chip_delay = 30,
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
.part_probe_types = part_probes,
|
.part_probe_types = part_probes,
|
||||||
.partitions = bfin_plat_nand_partitions,
|
.partitions = bfin_plat_nand_partitions,
|
||||||
.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
|
.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
.ctrl = {
|
.ctrl = {
|
||||||
.cmd_ctrl = bfin_plat_nand_cmd_ctrl,
|
.cmd_ctrl = bfin_plat_nand_cmd_ctrl,
|
||||||
|
|
|
@ -243,7 +243,6 @@ static struct platform_device bfin_uart0_device = {
|
||||||
|
|
||||||
#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
|
#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
const char *part_probes[] = { "cmdlinepart", NULL };
|
const char *part_probes[] = { "cmdlinepart", NULL };
|
||||||
|
|
||||||
static struct mtd_partition bfin_plat_nand_partitions[] = {
|
static struct mtd_partition bfin_plat_nand_partitions[] = {
|
||||||
|
@ -257,7 +256,6 @@ static struct mtd_partition bfin_plat_nand_partitions[] = {
|
||||||
.offset = MTDPART_OFS_APPEND,
|
.offset = MTDPART_OFS_APPEND,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#define BFIN_NAND_PLAT_CLE 2
|
#define BFIN_NAND_PLAT_CLE 2
|
||||||
#define BFIN_NAND_PLAT_ALE 3
|
#define BFIN_NAND_PLAT_ALE 3
|
||||||
|
@ -286,11 +284,9 @@ static struct platform_nand_data bfin_plat_nand_data = {
|
||||||
.chip = {
|
.chip = {
|
||||||
.nr_chips = 1,
|
.nr_chips = 1,
|
||||||
.chip_delay = 30,
|
.chip_delay = 30,
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
.part_probe_types = part_probes,
|
.part_probe_types = part_probes,
|
||||||
.partitions = bfin_plat_nand_partitions,
|
.partitions = bfin_plat_nand_partitions,
|
||||||
.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
|
.nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
.ctrl = {
|
.ctrl = {
|
||||||
.cmd_ctrl = bfin_plat_nand_cmd_ctrl,
|
.cmd_ctrl = bfin_plat_nand_cmd_ctrl,
|
||||||
|
|
|
@ -453,7 +453,6 @@ config MTD_PCMCIA_ANONYMOUS
|
||||||
config MTD_BFIN_ASYNC
|
config MTD_BFIN_ASYNC
|
||||||
tristate "Blackfin BF533-STAMP Flash Chip Support"
|
tristate "Blackfin BF533-STAMP Flash Chip Support"
|
||||||
depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS
|
depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS
|
||||||
select MTD_PARTITIONS
|
|
||||||
default y
|
default y
|
||||||
help
|
help
|
||||||
Map driver which allows for simultaneous utilization of
|
Map driver which allows for simultaneous utilization of
|
||||||
|
|
|
@ -41,9 +41,7 @@ struct async_state {
|
||||||
uint32_t flash_ambctl0, flash_ambctl1;
|
uint32_t flash_ambctl0, flash_ambctl1;
|
||||||
uint32_t save_ambctl0, save_ambctl1;
|
uint32_t save_ambctl0, save_ambctl1;
|
||||||
unsigned long irq_flags;
|
unsigned long irq_flags;
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
struct mtd_partition *parts;
|
struct mtd_partition *parts;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void switch_to_flash(struct async_state *state)
|
static void switch_to_flash(struct async_state *state)
|
||||||
|
@ -124,9 +122,7 @@ static void bfin_flash_copy_to(struct map_info *map, unsigned long to, const voi
|
||||||
switch_back(state);
|
switch_back(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
|
static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
|
||||||
#endif
|
|
||||||
|
|
||||||
static int __devinit bfin_flash_probe(struct platform_device *pdev)
|
static int __devinit bfin_flash_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
@ -169,22 +165,17 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
|
||||||
ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0);
|
ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n");
|
pr_devinit(KERN_NOTICE DRIVER_NAME ": Using commandline partition definition\n");
|
||||||
add_mtd_partitions(state->mtd, pdata->parts, ret);
|
mtd_device_register(state->mtd, pdata->parts, ret);
|
||||||
state->parts = pdata->parts;
|
state->parts = pdata->parts;
|
||||||
|
|
||||||
} else if (pdata->nr_parts) {
|
} else if (pdata->nr_parts) {
|
||||||
pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n");
|
pr_devinit(KERN_NOTICE DRIVER_NAME ": Using board partition definition\n");
|
||||||
add_mtd_partitions(state->mtd, pdata->parts, pdata->nr_parts);
|
mtd_device_register(state->mtd, pdata->parts, pdata->nr_parts);
|
||||||
|
} else {
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
pr_devinit(KERN_NOTICE DRIVER_NAME ": no partition info available, registering whole flash at once\n");
|
pr_devinit(KERN_NOTICE DRIVER_NAME ": no partition info available, registering whole flash at once\n");
|
||||||
add_mtd_device(state->mtd);
|
mtd_device_register(state->mtd, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, state);
|
platform_set_drvdata(pdev, state);
|
||||||
|
@ -196,10 +187,8 @@ static int __devexit bfin_flash_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct async_state *state = platform_get_drvdata(pdev);
|
struct async_state *state = platform_get_drvdata(pdev);
|
||||||
gpio_free(state->enet_flash_pin);
|
gpio_free(state->enet_flash_pin);
|
||||||
#ifdef CONFIG_MTD_PARTITIONS
|
mtd_device_unregister(state->mtd);
|
||||||
del_mtd_partitions(state->mtd);
|
|
||||||
kfree(state->parts);
|
kfree(state->parts);
|
||||||
#endif
|
|
||||||
map_destroy(state->mtd);
|
map_destroy(state->mtd);
|
||||||
kfree(state);
|
kfree(state);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче