Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176923
b: refs/heads/master
c: 4b56ffc
h: refs/heads/master
i:
  176921: 95b43b8
  176919: 755cdfe
v: v3
  • Loading branch information
H Hartley Sweeten authored and David Woodhouse committed Oct 20, 2009
1 parent cae0bb2 commit 09a09f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 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: 2d098a725333990d265dfe4754d1b63032c35afb
refs/heads/master: 4b56ffcacee937a85bf39e14872dd141e23ee85f
49 changes: 25 additions & 24 deletions trunk/drivers/mtd/maps/physmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,23 @@ static int physmap_flash_remove(struct platform_device *dev)
return 0;
platform_set_drvdata(dev, NULL);

if (info->cmtd == NULL)
return 0;

physmap_data = dev->dev.platform_data;

if (info->cmtd) {
#ifdef CONFIG_MTD_PARTITIONS
if (info->nr_parts || physmap_data->nr_parts)
if (mtd_has_partitions()) {
if (info->nr_parts || physmap_data->nr_parts) {
del_mtd_partitions(info->cmtd);
else

if (info->nr_parts)
kfree(info->parts);
} else {
del_mtd_device(info->cmtd);
#else
}
} else {
del_mtd_device(info->cmtd);
#endif
}
#ifdef CONFIG_MTD_PARTITIONS
if (info->nr_parts)
kfree(info->parts);
#endif

#ifdef CONFIG_MTD_CONCAT
if (info->cmtd != info->mtd[0])
Expand Down Expand Up @@ -169,22 +170,22 @@ static int physmap_flash_probe(struct platform_device *dev)
if (err)
goto err_out;

#ifdef CONFIG_MTD_PARTITIONS
err = parse_mtd_partitions(info->cmtd, part_probe_types,
&info->parts, 0);
if (err > 0) {
add_mtd_partitions(info->cmtd, info->parts, err);
info->nr_parts = err;
return 0;
}
if (mtd_has_partitions()) {
err = parse_mtd_partitions(info->cmtd, part_probe_types,
&info->parts, 0);
if (err > 0) {
add_mtd_partitions(info->cmtd, info->parts, err);
info->nr_parts = err;
return 0;
}

if (physmap_data->nr_parts) {
printk(KERN_NOTICE "Using physmap partition information\n");
add_mtd_partitions(info->cmtd, physmap_data->parts,
physmap_data->nr_parts);
return 0;
if (physmap_data->nr_parts) {
printk(KERN_NOTICE "Using physmap partition information\n");
add_mtd_partitions(info->cmtd, physmap_data->parts,
physmap_data->nr_parts);
return 0;
}
}
#endif

add_mtd_device(info->cmtd);
return 0;
Expand Down

0 comments on commit 09a09f7

Please sign in to comment.