aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2009-11-17 07:46:44 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-18 08:03:32 -0500
commit7adcdb4c1142dc446ab9d4c51ab09cc87e0749c9 (patch)
tree0f96cb355ed29a6190abff80bcd60e23bb97db53
parent63ae93a19094d88c8ca62543586b20e3a7ff7637 (diff)
drivers/atm/solos-pci.c: fix warning/bug, clean up code
drivers/atm/solos-pci.c: In function 'flash_upgrade': drivers/atm/solos-pci.c:528: warning: 'fw_name' may be used uninitialized in this function Cc: Chas Williams <chas@cmf.nrl.navy.mil> Cc: David Woodhouse <David.Woodhouse@intel.com> Cc: Nathan Williams <nathan@traverse.com.au> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-By: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/atm/solos-pci.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index d7ad19d2603a..51eed679a059 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -531,34 +531,37 @@ static int flash_upgrade(struct solos_card *card, int chip)
531 int numblocks = 0; 531 int numblocks = 0;
532 int offset; 532 int offset;
533 533
534 if (chip == 0) { 534 switch (chip) {
535 case 0:
535 fw_name = "solos-FPGA.bin"; 536 fw_name = "solos-FPGA.bin";
536 blocksize = FPGA_BLOCK; 537 blocksize = FPGA_BLOCK;
537 } 538 break;
538 539 case 1:
539 if (chip == 1) {
540 fw_name = "solos-Firmware.bin"; 540 fw_name = "solos-Firmware.bin";
541 blocksize = SOLOS_BLOCK; 541 blocksize = SOLOS_BLOCK;
542 } 542 break;
543 543 case 2:
544 if (chip == 2){
545 if (card->fpga_version > LEGACY_BUFFERS){ 544 if (card->fpga_version > LEGACY_BUFFERS){
546 fw_name = "solos-db-FPGA.bin"; 545 fw_name = "solos-db-FPGA.bin";
547 blocksize = FPGA_BLOCK; 546 blocksize = FPGA_BLOCK;
548 } else { 547 } else {
549 dev_info(&card->dev->dev, "FPGA version doesn't support daughter board upgrades\n"); 548 dev_info(&card->dev->dev, "FPGA version doesn't support"
549 " daughter board upgrades\n");
550 return -EPERM; 550 return -EPERM;
551 } 551 }
552 } 552 break;
553 553 case 3:
554 if (chip == 3){
555 if (card->fpga_version > LEGACY_BUFFERS){ 554 if (card->fpga_version > LEGACY_BUFFERS){
556 fw_name = "solos-Firmware.bin"; 555 fw_name = "solos-Firmware.bin";
557 blocksize = SOLOS_BLOCK; 556 blocksize = SOLOS_BLOCK;
558 } else { 557 } else {
559 dev_info(&card->dev->dev, "FPGA version doesn't support daughter board upgrades\n"); 558 dev_info(&card->dev->dev, "FPGA version doesn't support"
560 return -EPERM; 559 " daughter board upgrades\n");
560 return -EPERM;
561 } 561 }
562 break;
563 default:
564 return -ENODEV;
562 } 565 }
563 566
564 if (request_firmware(&fw, fw_name, &card->dev->dev)) 567 if (request_firmware(&fw, fw_name, &card->dev->dev))