aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ssb')
-rw-r--r--drivers/ssb/pci.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index 57c4ccfab1ee..f883dcfffe06 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -510,17 +510,15 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
510 sprom_do_read(bus, buf); 510 sprom_do_read(bus, buf);
511 err = sprom_check_crc(buf, bus->sprom_size); 511 err = sprom_check_crc(buf, bus->sprom_size);
512 if (err) { 512 if (err) {
513 /* check for rev 4 sprom - has special signature */ 513 /* try for a 440 byte SPROM - revision 4 and higher */
514 if (buf[32] == 0x5372) { 514 kfree(buf);
515 kfree(buf); 515 buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
516 buf = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16), 516 GFP_KERNEL);
517 GFP_KERNEL); 517 if (!buf)
518 if (!buf) 518 goto out;
519 goto out; 519 bus->sprom_size = SSB_SPROMSIZE_WORDS_R4;
520 bus->sprom_size = SSB_SPROMSIZE_WORDS_R4; 520 sprom_do_read(bus, buf);
521 sprom_do_read(bus, buf); 521 err = sprom_check_crc(buf, bus->sprom_size);
522 err = sprom_check_crc(buf, bus->sprom_size);
523 }
524 if (err) 522 if (err)
525 ssb_printk(KERN_WARNING PFX "WARNING: Invalid" 523 ssb_printk(KERN_WARNING PFX "WARNING: Invalid"
526 " SPROM CRC (corrupt SPROM)\n"); 524 " SPROM CRC (corrupt SPROM)\n");