]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/plat-ram.c
[MTD] [MAPS] fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / plat-ram.c
index 5d3c75451ca292afb002d6f817f5c7e6bc3c4569..7160e0eb09af19fc3aeabb6448881c1041d24cb7 100644 (file)
@@ -147,14 +147,13 @@ static int platram_probe(struct platform_device *pdev)
 
        pdata = pdev->dev.platform_data;
 
-       info = kmalloc(sizeof(*info), GFP_KERNEL);
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (info == NULL) {
                dev_err(&pdev->dev, "no memory for flash info\n");
                err = -ENOMEM;
                goto exit_error;
        }
 
-       memset(info, 0, sizeof(*info));
        platform_set_drvdata(pdev, info);
 
        info->dev = &pdev->dev;
@@ -170,7 +169,8 @@ static int platram_probe(struct platform_device *pdev)
                goto exit_free;
        }
 
-       dev_dbg(&pdev->dev, "got platform resource %p (0x%lx)\n", res, res->start);
+       dev_dbg(&pdev->dev, "got platform resource %p (0x%llx)\n", res,
+               (unsigned long long)res->start);
 
        /* setup map parameters */
 
@@ -251,6 +251,9 @@ static int platram_probe(struct platform_device *pdev)
 
 /* device driver info */
 
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:mtd-ram");
+
 static struct platform_driver platram_driver = {
        .probe          = platram_probe,
        .remove         = platram_remove,