Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252526
b: refs/heads/master
c: fdbf3bf
h: refs/heads/master
v: v3
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent 5787be9 commit a9e4d30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5af3aa24cf552e1a8c2874697d1f30769d8abf5c
refs/heads/master: fdbf3bf6b855233cd618021c702accb69b8b10bc
1 change: 0 additions & 1 deletion trunk/drivers/mtd/maps/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ config MTD_GPIO_ADDR
tristate "GPIO-assisted Flash Chip Support"
depends on GENERIC_GPIO || GPIOLIB
depends on MTD_COMPLEX_MAPPINGS
select MTD_PARTITIONS
help
Map driver which allows flashes to be partially physically addressed
and assisted by GPIOs.
Expand Down
27 changes: 10 additions & 17 deletions trunk/drivers/mtd/maps/gpio-addr-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ static void gf_copy_to(struct map_info *map, unsigned long to, const void *from,
memcpy_toio(map->virt + (to % state->win_size), from, len);
}

#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
#endif

/**
* gpio_flash_probe() - setup a mapping for a GPIO assisted flash
Expand Down Expand Up @@ -189,7 +187,7 @@ static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
*/
static int __devinit gpio_flash_probe(struct platform_device *pdev)
{
int ret;
int nr_parts;
size_t i, arr_size;
struct physmap_flash_data *pdata;
struct resource *memory;
Expand Down Expand Up @@ -254,24 +252,21 @@ static int __devinit gpio_flash_probe(struct platform_device *pdev)
return -ENXIO;
}

#ifdef CONFIG_MTD_PARTITIONS
ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0);
if (ret > 0) {
nr_parts = parse_mtd_partitions(state->mtd, part_probe_types,
&pdata->parts, 0);
if (nr_parts > 0) {
pr_devinit(KERN_NOTICE PFX "Using commandline partition definition\n");
add_mtd_partitions(state->mtd, pdata->parts, ret);
kfree(pdata->parts);

} else if (pdata->nr_parts) {
pr_devinit(KERN_NOTICE PFX "Using board partition definition\n");
add_mtd_partitions(state->mtd, pdata->parts, pdata->nr_parts);

} else
#endif
{
nr_parts = pdata->nr_parts;
} else {
pr_devinit(KERN_NOTICE PFX "no partition info available, registering whole flash at once\n");
add_mtd_device(state->mtd);
nr_parts = 0;
}

mtd_device_register(state->mtd, pdata->parts, nr_parts);

return 0;
}

Expand All @@ -282,9 +277,7 @@ static int __devexit gpio_flash_remove(struct platform_device *pdev)
do {
gpio_free(state->gpio_addrs[i]);
} while (++i < state->gpio_count);
#ifdef CONFIG_MTD_PARTITIONS
del_mtd_partitions(state->mtd);
#endif
mtd_device_unregister(state->mtd);
map_destroy(state->mtd);
kfree(state);
return 0;
Expand Down

0 comments on commit a9e4d30

Please sign in to comment.