1 # Ensure that the MTD is shut down on halt/reboot, otherwise the
4 --- linux-2.6.12.2/drivers/mtd/maps/ixp4xx.c.orig 2005-07-17 15:07:47.790388300 -0700
5 +++ linux-2.6.12.2/drivers/mtd/maps/ixp4xx.c 2005-07-17 17:00:08.082672710 -0700
10 +static void ixp4xx_flash_shutdown(struct device *_dev)
12 + struct platform_device *dev = to_platform_device(_dev);
13 + struct flash_platform_data *plat = dev->dev.platform_data;
14 + struct ixp4xx_flash_info *info = dev_get_drvdata(&dev->dev);
17 + dev_set_drvdata(&dev->dev, NULL);
23 + * This is required for a soft reboot to work.
26 + ixp4xx_write16(&info->map, d, 0x55 * 0x2);
29 + /* This is commented out because it seems to cause a kernel
30 + * panic (at least if it isn't commented out the kernel fails
31 + * to shut down). Should be investigated.
34 + del_mtd_partitions(info->mtd);
35 + map_destroy(info->mtd);
38 + if (info->map.map_priv_1)
39 + iounmap((void *) info->map.map_priv_1);
41 + if (info->partitions)
42 + kfree(info->partitions);
45 + release_resource(info->res);
52 + /* Disable flash write */
53 + *IXP4XX_EXP_CS0 &= ~IXP4XX_FLASH_WRITABLE;
56 static int ixp4xx_flash_probe(struct device *_dev)
58 struct platform_device *dev = to_platform_device(_dev);
60 .bus = &platform_bus_type,
61 .probe = ixp4xx_flash_probe,
62 .remove = ixp4xx_flash_remove,
63 + .shutdown = ixp4xx_flash_shutdown,
66 static int __init ixp4xx_flash_init(void)