aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/m8xx_pcmcia.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/m8xx_pcmcia.c')
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index e070a2896769..3b72be880401 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -427,7 +427,7 @@ static int voltage_set(int slot, int vcc, int vpp)
427 reg |= BCSR1_PCCVCC1; 427 reg |= BCSR1_PCCVCC1;
428 break; 428 break;
429 default: 429 default:
430 return 1; 430 goto out_unmap;
431 } 431 }
432 432
433 switch(vpp) { 433 switch(vpp) {
@@ -438,15 +438,15 @@ static int voltage_set(int slot, int vcc, int vpp)
438 if(vcc == vpp) 438 if(vcc == vpp)
439 reg |= BCSR1_PCCVPP1; 439 reg |= BCSR1_PCCVPP1;
440 else 440 else
441 return 1; 441 goto out_unmap;
442 break; 442 break;
443 case 120: 443 case 120:
444 if ((vcc == 33) || (vcc == 50)) 444 if ((vcc == 33) || (vcc == 50))
445 reg |= BCSR1_PCCVPP0; 445 reg |= BCSR1_PCCVPP0;
446 else 446 else
447 return 1; 447 goto out_unmap;
448 default: 448 default:
449 return 1; 449 goto out_unmap;
450 } 450 }
451 451
452 /* first, turn off all power */ 452 /* first, turn off all power */
@@ -457,6 +457,10 @@ static int voltage_set(int slot, int vcc, int vpp)
457 457
458 iounmap(bcsr_io); 458 iounmap(bcsr_io);
459 return 0; 459 return 0;
460
461out_unmap:
462 iounmap(bcsr_io);
463 return 1;
460} 464}
461 465
462#define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V 466#define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V