Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274835
b: refs/heads/master
c: 769dc43
h: refs/heads/master
i:
  274833: 9f69146
  274831: e759520
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov authored and Artem Bityutskiy committed Sep 11, 2011
1 parent f73a670 commit f97bea9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 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: c77d8092c761bc0ee219fd869e6cde876e2b7aa4
refs/heads/master: 769dc431869a021b85feca607c7800c59822de9c
30 changes: 3 additions & 27 deletions trunk/drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ struct sa_subdev_info {
};

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 @@ -231,8 +229,6 @@ static void sa1100_destroy(struct sa_info *info, struct flash_platform_data *pla
mtd_concat_destroy(info->mtd);
}

kfree(info->parts);

for (i = info->num_subdev - 1; i >= 0; i--)
sa1100_destroy_subdev(&info->subdev[i]);
kfree(info);
Expand Down Expand Up @@ -341,10 +337,8 @@ static const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
static int __devinit sa1100_mtd_probe(struct platform_device *pdev)
{
struct flash_platform_data *plat = pdev->dev.platform_data;
struct mtd_partition *parts;
const char *part_type = NULL;
struct sa_info *info;
int err, nr_parts = 0;
int err;

if (!plat)
return -ENODEV;
Expand All @@ -358,26 +352,8 @@ static int __devinit sa1100_mtd_probe(struct platform_device *pdev)
/*
* Partition selection stuff.
*/
nr_parts = parse_mtd_partitions(info->mtd, part_probes, &parts, 0);
if (nr_parts > 0) {
info->parts = parts;
part_type = "dynamic";
} else {
parts = plat->parts;
nr_parts = plat->nr_parts;
part_type = "static";
}

if (nr_parts == 0)
printk(KERN_NOTICE "SA1100 flash: no partition info "
"available, registering whole flash\n");
else
printk(KERN_NOTICE "SA1100 flash: using %s partition "
"definition\n", part_type);

mtd_device_register(info->mtd, parts, nr_parts);

info->nr_parts = nr_parts;
mtd_device_parse_register(info->mtd, part_probes, 0,
plat->parts, plat->nr_parts);

platform_set_drvdata(pdev, info);
err = 0;
Expand Down

0 comments on commit f97bea9

Please sign in to comment.