]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pcmcia/m8xx_pcmcia.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / pcmcia / m8xx_pcmcia.c
index e070a2896769ff2d2f27b640239b3a27fbd015fa..3b72be880401398d93b6465c82333aa84af5e585 100644 (file)
@@ -427,7 +427,7 @@ static int voltage_set(int slot, int vcc, int vpp)
                        reg |= BCSR1_PCCVCC1;
                        break;
                default:
-                       return 1;
+                       goto out_unmap;
        }
 
        switch(vpp) {
@@ -438,15 +438,15 @@ static int voltage_set(int slot, int vcc, int vpp)
                        if(vcc == vpp)
                                reg |= BCSR1_PCCVPP1;
                        else
-                               return 1;
+                               goto out_unmap;
                        break;
                case 120:
                        if ((vcc == 33) || (vcc == 50))
                                reg |= BCSR1_PCCVPP0;
                        else
-                               return 1;
+                               goto out_unmap;
                default:
-                       return 1;
+                       goto out_unmap;
        }
 
        /* first, turn off all power */
@@ -457,6 +457,10 @@ static int voltage_set(int slot, int vcc, int vpp)
 
        iounmap(bcsr_io);
        return 0;
+
+out_unmap:
+       iounmap(bcsr_io);
+       return 1;
 }
 
 #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V