Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252520
b: refs/heads/master
c: 711a632
h: refs/heads/master
v: v3
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent 292f950 commit bcf2dad
Show file tree
Hide file tree
Showing 4 changed files with 6 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: 47854888cc21cb1afd7797c66886a8b06cf35979
refs/heads/master: 711a632d1f0d3ffc576f7a298f66888f66014d61
1 change: 0 additions & 1 deletion trunk/drivers/mtd/onenand/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
menuconfig MTD_ONENAND
tristate "OneNAND Device Support"
depends on MTD
select MTD_PARTITIONS
help
This enables support for accessing all type of OneNAND flash
devices. For further information see
Expand Down
16 changes: 4 additions & 12 deletions trunk/drivers/mtd/onenand/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
*/
#define DRIVER_NAME "onenand-flash"

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

struct onenand_info {
struct mtd_info mtd;
Expand Down Expand Up @@ -75,15 +73,13 @@ static int __devinit generic_onenand_probe(struct platform_device *pdev)
goto out_iounmap;
}

#ifdef CONFIG_MTD_PARTITIONS
err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
if (err > 0)
add_mtd_partitions(&info->mtd, info->parts, err);
mtd_device_register(&info->mtd, info->parts, err);
else if (err <= 0 && pdata && pdata->parts)
add_mtd_partitions(&info->mtd, pdata->parts, pdata->nr_parts);
mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
else
#endif
err = add_mtd_device(&info->mtd);
err = mtd_device_register(&info->mtd, NULL, 0);

platform_set_drvdata(pdev, info);

Expand All @@ -108,11 +104,7 @@ static int __devexit generic_onenand_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);

if (info) {
if (info->parts)
del_mtd_partitions(&info->mtd);
else
del_mtd_device(&info->mtd);

mtd_device_unregister(&info->mtd);
onenand_release(&info->mtd);
release_mem_region(res->start, size);
iounmap(info->onenand.base);
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -4142,12 +4142,8 @@ void onenand_release(struct mtd_info *mtd)
{
struct onenand_chip *this = mtd->priv;

#ifdef CONFIG_MTD_PARTITIONS
/* Deregister partitions */
del_mtd_partitions (mtd);
#endif
/* Deregister the device */
del_mtd_device (mtd);
mtd_device_unregister(mtd);

/* Free bad block table memory, if allocated */
if (this->bbm) {
Expand Down

0 comments on commit bcf2dad

Please sign in to comment.