ath9k: Simplify and fix eeprom endianness swapping
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sat, 31 Oct 2015 12:57:32 +0000 (13:57 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 8 Dec 2015 14:50:18 +0000 (16:50 +0200)
commit6fa658fd5ab26a769ca7df7bfdd53c212a0ba852
tree9fca9742418c07304b0389ae236ed0442dbe86f8
parentb057886524be060021e3cfad0ba8458c850330cd
ath9k: Simplify and fix eeprom endianness swapping

The three eeprom implementations had quite some duplicate code when it
came to endianness swapping.
Additionally there was a bug in eeprom_4k and eeprom_9287 which
prevented the endianness swapping from working correctly, because the
swapping code was guarded within an "if (!ath9k_hw_use_flash(ah))". In
eeprom_def this check did not exist, so it seems that eeprom_def was the
only implementation where endianness swapping worked.

This patch takes the duplicate code and moves it from eeprom_* to
eeprom.c. The new code is derived from eeprom_def, while taking into
account the specifics from the other implementations.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath9k/eeprom.c
drivers/net/wireless/ath/ath9k/eeprom.h
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c