diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-03-23 20:57:24 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-30 20:15:19 +0200 |
commit | f9f84e96f6d642aa7b337c22cbb7d6f936039fda (patch) | |
tree | f9887db51eda5716a8d1a33abee9af7b9d7fb5f3 /drivers/net/wireless/ath/ath9k/htc_drv_init.c | |
parent | cfg80211: Add nl80211 event for deletion of a station entry (diff) | |
download | linux-f9f84e96f6d642aa7b337c22cbb7d6f936039fda.tar.xz linux-f9f84e96f6d642aa7b337c22cbb7d6f936039fda.zip |
ath9k_hw: embed the ath_ops callbacks in the ath_hw struct
With this change, loading the address to a register read/write function
costs only one pointer dereference instead of two. On MIPS this reduces
ath9k_hw binary size from 326k down to 321k.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index fc67c937e172..4e26946f7ab2 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -430,14 +430,6 @@ static void ath9k_regwrite_flush(void *hw_priv) mutex_unlock(&priv->wmi->multi_write_mutex); } -static const struct ath_ops ath9k_common_ops = { - .read = ath9k_regread, - .multi_read = ath9k_multi_regread, - .write = ath9k_regwrite, - .enable_write_buffer = ath9k_enable_regwrite_buffer, - .write_flush = ath9k_regwrite_flush, -}; - static void ath_usb_read_cachesize(struct ath_common *common, int *csz) { *csz = L1_CACHE_BYTES >> 2; @@ -658,10 +650,15 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, ah->hw_version.subsysid = 0; /* FIXME */ ah->hw_version.usbdev = drv_info; ah->ah_flags |= AH_USE_EEPROM; + ah->reg_ops.read = ath9k_regread; + ah->reg_ops.multi_read = ath9k_multi_regread; + ah->reg_ops.write = ath9k_regwrite; + ah->reg_ops.enable_write_buffer = ath9k_enable_regwrite_buffer; + ah->reg_ops.write_flush = ath9k_regwrite_flush; priv->ah = ah; common = ath9k_hw_common(ah); - common->ops = &ath9k_common_ops; + common->ops = &ah->reg_ops; common->bus_ops = &ath9k_usb_bus_ops; common->ah = ah; common->hw = priv->hw; |