--- zzzz-none-000/linux-2.6.19.2/drivers/mtd/maps/omap_nor.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/drivers/mtd/maps/omap_nor.c 2007-01-11 07:38:19.000000000 +0000 @@ -61,12 +61,14 @@ { static int count; - if (enable) { - if (count++ == 0) - OMAP_EMIFS_CONFIG_REG |= OMAP_EMIFS_CONFIG_WP; - } else { - if (count && (--count == 0)) - OMAP_EMIFS_CONFIG_REG &= ~OMAP_EMIFS_CONFIG_WP; + if (!cpu_is_omap24xx()) { + if (enable) { + if (count++ == 0) + OMAP_EMIFS_CONFIG_REG |= OMAP_EMIFS_CONFIG_WP; + } else { + if (count && (--count == 0)) + OMAP_EMIFS_CONFIG_REG &= ~OMAP_EMIFS_CONFIG_WP; + } } } @@ -135,11 +137,12 @@ 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