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>
This commit is contained in:
Родитель
63ae93a190
Коммит
7adcdb4c11
|
@ -531,34 +531,37 @@ static int flash_upgrade(struct solos_card *card, int chip)
|
||||||
int numblocks = 0;
|
int numblocks = 0;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
||||||
if (chip == 0) {
|
switch (chip) {
|
||||||
|
case 0:
|
||||||
fw_name = "solos-FPGA.bin";
|
fw_name = "solos-FPGA.bin";
|
||||||
blocksize = FPGA_BLOCK;
|
blocksize = FPGA_BLOCK;
|
||||||
}
|
break;
|
||||||
|
case 1:
|
||||||
if (chip == 1) {
|
|
||||||
fw_name = "solos-Firmware.bin";
|
fw_name = "solos-Firmware.bin";
|
||||||
blocksize = SOLOS_BLOCK;
|
blocksize = SOLOS_BLOCK;
|
||||||
}
|
break;
|
||||||
|
case 2:
|
||||||
if (chip == 2){
|
|
||||||
if (card->fpga_version > LEGACY_BUFFERS){
|
if (card->fpga_version > LEGACY_BUFFERS){
|
||||||
fw_name = "solos-db-FPGA.bin";
|
fw_name = "solos-db-FPGA.bin";
|
||||||
blocksize = FPGA_BLOCK;
|
blocksize = FPGA_BLOCK;
|
||||||
} else {
|
} 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;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
case 3:
|
||||||
if (chip == 3){
|
|
||||||
if (card->fpga_version > LEGACY_BUFFERS){
|
if (card->fpga_version > LEGACY_BUFFERS){
|
||||||
fw_name = "solos-Firmware.bin";
|
fw_name = "solos-Firmware.bin";
|
||||||
blocksize = SOLOS_BLOCK;
|
blocksize = SOLOS_BLOCK;
|
||||||
} else {
|
} 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"
|
||||||
return -EPERM;
|
" daughter board upgrades\n");
|
||||||
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request_firmware(&fw, fw_name, &card->dev->dev))
|
if (request_firmware(&fw, fw_name, &card->dev->dev))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче