diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-03-23 15:57:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-03-30 14:15:19 -0400 |
commit | f9f84e96f6d642aa7b337c22cbb7d6f936039fda (patch) | |
tree | f9887db51eda5716a8d1a33abee9af7b9d7fb5f3 /drivers/net/wireless/ath/ath9k/init.c | |
parent | ec15e68ba6a505631016f230899bafbb7b8cd0d6 (diff) |
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/init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index b590a9e7943a..da114c2f0dbe 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -196,11 +196,6 @@ static unsigned int ath9k_ioread32(void *hw_priv, u32 reg_offset) | |||
196 | return val; | 196 | return val; |
197 | } | 197 | } |
198 | 198 | ||
199 | static const struct ath_ops ath9k_common_ops = { | ||
200 | .read = ath9k_ioread32, | ||
201 | .write = ath9k_iowrite32, | ||
202 | }; | ||
203 | |||
204 | /**************************/ | 199 | /**************************/ |
205 | /* Initialization */ | 200 | /* Initialization */ |
206 | /**************************/ | 201 | /**************************/ |
@@ -551,6 +546,8 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
551 | ah->hw = sc->hw; | 546 | ah->hw = sc->hw; |
552 | ah->hw_version.devid = devid; | 547 | ah->hw_version.devid = devid; |
553 | ah->hw_version.subsysid = subsysid; | 548 | ah->hw_version.subsysid = subsysid; |
549 | ah->reg_ops.read = ath9k_ioread32; | ||
550 | ah->reg_ops.write = ath9k_iowrite32; | ||
554 | sc->sc_ah = ah; | 551 | sc->sc_ah = ah; |
555 | 552 | ||
556 | if (!pdata) { | 553 | if (!pdata) { |
@@ -563,7 +560,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
563 | } | 560 | } |
564 | 561 | ||
565 | common = ath9k_hw_common(ah); | 562 | common = ath9k_hw_common(ah); |
566 | common->ops = &ath9k_common_ops; | 563 | common->ops = &ah->reg_ops; |
567 | common->bus_ops = bus_ops; | 564 | common->bus_ops = bus_ops; |
568 | common->ah = ah; | 565 | common->ah = ah; |
569 | common->hw = sc->hw; | 566 | common->hw = sc->hw; |