summaryrefslogtreecommitdiffstats
path: root/drivers/atm/solos-pci.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2009-11-17 12:46:44 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-18 05:03:32 -0800
commit7adcdb4c1142dc446ab9d4c51ab09cc87e0749c9 (patch)
tree0f96cb355ed29a6190abff80bcd60e23bb97db53 /drivers/atm/solos-pci.c
parent63ae93a19094d88c8ca62543586b20e3a7ff7637 (diff)
downloadlinux-7adcdb4c1142dc446ab9d4c51ab09cc87e0749c9.tar.bz2
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>
Diffstat (limited to 'drivers/atm/solos-pci.c')
-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)
int numblocks = 0;
int offset;
- if (chip == 0) {
+ switch (chip) {
+ case 0:
fw_name = "solos-FPGA.bin";
blocksize = FPGA_BLOCK;
- }
-
- if (chip == 1) {
+ break;
+ case 1:
fw_name = "solos-Firmware.bin";
blocksize = SOLOS_BLOCK;
- }
-
- if (chip == 2){
+ break;
+ case 2:
if (card->fpga_version > LEGACY_BUFFERS){
fw_name = "solos-db-FPGA.bin";
blocksize = FPGA_BLOCK;
} else {
- dev_info(&card->dev->dev, "FPGA version doesn't support daughter board upgrades\n");
+ dev_info(&card->dev->dev, "FPGA version doesn't support"
+ " daughter board upgrades\n");
return -EPERM;
}
- }
-
- if (chip == 3){
+ break;
+ case 3:
if (card->fpga_version > LEGACY_BUFFERS){
fw_name = "solos-Firmware.bin";
blocksize = SOLOS_BLOCK;
} else {
- dev_info(&card->dev->dev, "FPGA version doesn't support daughter board upgrades\n");
- return -EPERM;
+ dev_info(&card->dev->dev, "FPGA version doesn't support"
+ " daughter board upgrades\n");
+ return -EPERM;
}
+ break;
+ default:
+ return -ENODEV;
}
if (request_firmware(&fw, fw_name, &card->dev->dev))