]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/omap_nor.c
[PATCH] ARM: OMAP: MTD NOR mapping driver remove partitions created from platform...
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / omap_nor.c
index a6e705fa4e63b8177103a257310263647eca94b7..6614e9721f9228b4138df80579530c8b63b4c607 100644 (file)
@@ -137,11 +137,12 @@ out_free_info:
 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