]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/sa1100-flash.c
[MTD] [MAPS] fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / sa1100-flash.c
index 5cefb015633ce896e2a08dc75269c93169496573..c7d5a52a2d559e997c62ba629bdf38f28f72e2c1 100644 (file)
@@ -5,7 +5,6 @@
  *
  * $Id: sa1100-flash.c,v 1.51 2005/11/07 11:14:28 gleixner Exp $
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
@@ -274,14 +273,12 @@ sa1100_setup_mtd(struct platform_device *pdev, struct flash_platform_data *plat)
        /*
         * Allocate the map_info structs in one go.
         */
-       info = kmalloc(size, GFP_KERNEL);
+       info = kzalloc(size, GFP_KERNEL);
        if (!info) {
                ret = -ENOMEM;
                goto out;
        }
 
-       memset(info, 0, size);
-
        if (plat->init) {
                ret = plat->init();
                if (ret)
@@ -459,6 +456,7 @@ static struct platform_driver sa1100_mtd_driver = {
        .shutdown       = sa1100_mtd_shutdown,
        .driver         = {
                .name   = "flash",
+               .owner  = THIS_MODULE,
        },
 };
 
@@ -478,3 +476,4 @@ module_exit(sa1100_mtd_exit);
 MODULE_AUTHOR("Nicolas Pitre");
 MODULE_DESCRIPTION("SA1100 CFI map driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:flash");