rt2x00: Remove debugfs CSR access wrappers
Move calculation of CSR register offset into rt2x00debug.c and remove the wrapper functions from each individual driver. (Except rt2500usb, which still needs to wrap for the different value type argument). Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
committed by
John W. Linville
parent
f161796700
commit
743b97caf9
@ -228,43 +228,34 @@ static void rt61pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RT2X00_LIB_DEBUGFS
|
||||
#define CSR_OFFSET(__word) ( CSR_REG_BASE + ((__word) * sizeof(u32)) )
|
||||
|
||||
static void rt61pci_read_csr(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int word, u32 *data)
|
||||
{
|
||||
rt2x00pci_register_read(rt2x00dev, CSR_OFFSET(word), data);
|
||||
}
|
||||
|
||||
static void rt61pci_write_csr(struct rt2x00_dev *rt2x00dev,
|
||||
const unsigned int word, u32 data)
|
||||
{
|
||||
rt2x00pci_register_write(rt2x00dev, CSR_OFFSET(word), data);
|
||||
}
|
||||
|
||||
static const struct rt2x00debug rt61pci_rt2x00debug = {
|
||||
.owner = THIS_MODULE,
|
||||
.csr = {
|
||||
.read = rt61pci_read_csr,
|
||||
.write = rt61pci_write_csr,
|
||||
.read = rt2x00pci_register_read,
|
||||
.write = rt2x00pci_register_write,
|
||||
.flags = RT2X00DEBUGFS_OFFSET,
|
||||
.word_base = CSR_REG_BASE,
|
||||
.word_size = sizeof(u32),
|
||||
.word_count = CSR_REG_SIZE / sizeof(u32),
|
||||
},
|
||||
.eeprom = {
|
||||
.read = rt2x00_eeprom_read,
|
||||
.write = rt2x00_eeprom_write,
|
||||
.word_base = EEPROM_BASE,
|
||||
.word_size = sizeof(u16),
|
||||
.word_count = EEPROM_SIZE / sizeof(u16),
|
||||
},
|
||||
.bbp = {
|
||||
.read = rt61pci_bbp_read,
|
||||
.write = rt61pci_bbp_write,
|
||||
.word_base = BBP_BASE,
|
||||
.word_size = sizeof(u8),
|
||||
.word_count = BBP_SIZE / sizeof(u8),
|
||||
},
|
||||
.rf = {
|
||||
.read = rt2x00_rf_read,
|
||||
.write = rt61pci_rf_write,
|
||||
.word_base = RF_BASE,
|
||||
.word_size = sizeof(u32),
|
||||
.word_count = RF_SIZE / sizeof(u32),
|
||||
},
|
||||
|
Reference in New Issue
Block a user