Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11299
b: refs/heads/master
c: 0d2ef7d
h: refs/heads/master
i:
  11297: c728043
  11295: a75d3b4
v: v3
  • Loading branch information
Russell King authored and Russell King committed Oct 29, 2005
1 parent c039972 commit 4d6e759
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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: 57725f0a94435355214977bb9b0e5089bba1b173
refs/heads/master: 0d2ef7d73e0b5173af3940139569bebd2375f441
18 changes: 15 additions & 3 deletions trunk/drivers/mtd/maps/sa1100-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int sa1100_probe_subdev(struct sa_subdev_info *subdev, struct resource *r
return ret;
}

static void sa1100_destroy(struct sa_info *info)
static void sa1100_destroy(struct sa_info *info, struct flash_platform_data *plat)
{
int i;

Expand All @@ -242,6 +242,9 @@ static void sa1100_destroy(struct sa_info *info)
for (i = info->num_subdev - 1; i >= 0; i--)
sa1100_destroy_subdev(&info->subdev[i]);
kfree(info);

if (plat->exit)
plat->exit();
}

static struct sa_info *__init
Expand Down Expand Up @@ -275,6 +278,12 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)

memset(info, 0, size);

if (plat->init) {
ret = plat->init();
if (ret)
goto err;
}

/*
* Claim and then map the memory regions.
*/
Expand Down Expand Up @@ -336,7 +345,7 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
return info;

err:
sa1100_destroy(info);
sa1100_destroy(info, plat);
out:
return ERR_PTR(ret);
}
Expand Down Expand Up @@ -397,8 +406,11 @@ static int __init sa1100_mtd_probe(struct device *dev)
static int __exit sa1100_mtd_remove(struct device *dev)
{
struct sa_info *info = dev_get_drvdata(dev);
struct flash_platform_data *plat = dev->platform_data;

dev_set_drvdata(dev, NULL);
sa1100_destroy(info);
sa1100_destroy(info, plat);

return 0;
}

Expand Down

0 comments on commit 4d6e759

Please sign in to comment.