]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/maps/pcmciamtd.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
[linux-2.6-omap-h63xx.git] / drivers / mtd / maps / pcmciamtd.c
index c861134cbc48d253ccc3530568402b0de0665441..1912d968718b38e81752b8c5df587b9081ef92f7 100644 (file)
@@ -33,7 +33,7 @@ MODULE_PARM_DESC(debug, "Set Debug Level 0=quiet, 5=noisy");
 #undef DEBUG
 #define DEBUG(n, format, arg...) \
        if (n <= debug) {        \
-               printk(KERN_DEBUG __FILE__ ":%s(): " format "\n", __FUNCTION__ , ## arg); \
+               printk(KERN_DEBUG __FILE__ ":%s(): " format "\n", __func__ , ## arg); \
        }
 
 #else
@@ -602,6 +602,10 @@ static int pcmciamtd_config(struct pcmcia_device *link)
        ret = pcmcia_request_configuration(link, &link->conf);
        if(ret != CS_SUCCESS) {
                cs_error(link, RequestConfiguration, ret);
+               if (dev->win_base) {
+                       iounmap(dev->win_base);
+                       dev->win_base = NULL;
+               }
                return -ENODEV;
        }
 
@@ -731,11 +735,10 @@ static int pcmciamtd_probe(struct pcmcia_device *link)
        struct pcmciamtd_dev *dev;
 
        /* Create new memory card device */
-       dev = kmalloc(sizeof(*dev), GFP_KERNEL);
+       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
        if (!dev) return -ENOMEM;
        DEBUG(1, "dev=0x%p", dev);
 
-       memset(dev, 0, sizeof(*dev));
        dev->p_dev = link;
        link->priv = dev;