rt2x00: Correctly detect 93C86 EEPROMs in rt2800pci.
authorGertjan van Wingerde <gwingerde@gmail.com>
Tue, 29 Jun 2010 19:44:18 +0000 (21:44 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 30 Jun 2010 19:00:51 +0000 (15:00 -0400)
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800pci.c

index 0af53bdb5c74f55496a9ebc1f3112c63f6ac38ea..b48b9494845e1b3df74ef31d5fec6a3c9f90de17 100644 (file)
@@ -139,8 +139,18 @@ static void rt2800pci_read_eeprom_pci(struct rt2x00_dev *rt2x00dev)
        eeprom.data = rt2x00dev;
        eeprom.register_read = rt2800pci_eepromregister_read;
        eeprom.register_write = rt2800pci_eepromregister_write;
-       eeprom.width = !rt2x00_get_field32(reg, E2PROM_CSR_TYPE) ?
-           PCI_EEPROM_WIDTH_93C46 : PCI_EEPROM_WIDTH_93C66;
+       switch (rt2x00_get_field32(reg, E2PROM_CSR_TYPE))
+       {
+       case 0:
+               eeprom.width = PCI_EEPROM_WIDTH_93C46;
+               break;
+       case 1:
+               eeprom.width = PCI_EEPROM_WIDTH_93C66;
+               break;
+       default:
+               eeprom.width = PCI_EEPROM_WIDTH_93C86;
+               break;
+       }
        eeprom.reg_data_in = 0;
        eeprom.reg_data_out = 0;
        eeprom.reg_data_clock = 0;