Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252531
b: refs/heads/master
c: 095dd50
h: refs/heads/master
i:
  252529: dc94281
  252527: 4d726e5
v: v3
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent 066dd6a commit 48041a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 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: 902766bfdfdacc01deb6857bada61cd1e5dc40b0
refs/heads/master: 095dd5003f531514170fd1645ab31ed88b56aaf5
24 changes: 9 additions & 15 deletions trunk/drivers/mtd/maps/plat-ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,11 @@ static int platram_remove(struct platform_device *pdev)
return 0;

if (info->mtd) {
#ifdef CONFIG_MTD_PARTITIONS
mtd_device_unregister(info->mtd);
if (info->partitions) {
del_mtd_partitions(info->mtd);
if (info->free_partitions)
kfree(info->partitions);
}
#endif
del_mtd_device(info->mtd);
map_destroy(info->mtd);
}

Expand Down Expand Up @@ -231,32 +228,29 @@ static int platram_probe(struct platform_device *pdev)
/* check to see if there are any available partitions, or wether
* to add this device whole */

#ifdef CONFIG_MTD_PARTITIONS
if (!pdata->nr_partitions) {
/* try to probe using the supplied probe type */
if (pdata->probes) {
err = parse_mtd_partitions(info->mtd, pdata->probes,
&info->partitions, 0);
info->free_partitions = 1;
if (err > 0)
err = add_mtd_partitions(info->mtd,
err = mtd_device_register(info->mtd,
info->partitions, err);
}
}
/* use the static mapping */
else
err = add_mtd_partitions(info->mtd, pdata->partitions,
pdata->nr_partitions);
#endif /* CONFIG_MTD_PARTITIONS */

if (add_mtd_device(info->mtd)) {
dev_err(&pdev->dev, "add_mtd_device() failed\n");
err = -ENOMEM;
}

err = mtd_device_register(info->mtd, pdata->partitions,
pdata->nr_partitions);
if (!err)
dev_info(&pdev->dev, "registered mtd device\n");

/* add the whole device. */
err = mtd_device_register(info->mtd, NULL, 0);
if (err)
dev_err(&pdev->dev, "failed to register the entire device\n");

return err;

exit_free:
Expand Down

0 comments on commit 48041a0

Please sign in to comment.