Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11300
b: refs/heads/master
c: 822e5e7
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Oct 29, 2005
1 parent 4d6e759 commit c89e0b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 0d2ef7d73e0b5173af3940139569bebd2375f441
refs/heads/master: 822e5e72697ce06e4425c17d161b0482c7d9b6d4
11 changes: 9 additions & 2 deletions trunk/drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ struct sa_info {
struct mtd_partition *parts;
struct mtd_info *mtd;
int num_subdev;
unsigned int nr_parts;
struct sa_subdev_info subdev[0];
};

Expand Down Expand Up @@ -228,8 +229,12 @@ static void sa1100_destroy(struct sa_info *info, struct flash_platform_data *pla
int i;

if (info->mtd) {
del_mtd_partitions(info->mtd);

if (info->nr_parts == 0)
del_mtd_device(info->mtd);
#ifdef CONFIG_MTD_PARTITIONS
else
del_mtd_partitions(info->mtd);
#endif
#ifdef CONFIG_MTD_CONCAT
if (info->mtd != info->subdev[0].mtd)
mtd_concat_destroy(info->mtd);
Expand Down Expand Up @@ -396,6 +401,8 @@ static int __init sa1100_mtd_probe(struct device *dev)
add_mtd_partitions(info->mtd, parts, nr_parts);
}

info->nr_parts = nr_parts;

dev_set_drvdata(dev, info);
err = 0;

Expand Down

0 comments on commit c89e0b0

Please sign in to comment.