OMAP MTD NOR mapping driver remove partitions created from platform data.
Signed-off-by: Todd Poynor <tpoynor@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
static int __devexit omapflash_remove(struct platform_device *pdev)
{
struct omapflash_info *info = platform_get_drvdata(pdev);
+ struct flash_platform_data *pdata = pdev->dev.platform_data;
platform_set_drvdata(pdev, NULL);
if (info) {
- if (info->parts) {
+ if (info->parts || (pdata && pdata->parts)) {
del_mtd_partitions(info->mtd);
kfree(info->parts);
} else