aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ralink/rt2x00/rt2x00.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-05-17 16:46:53 +0200
committerKalle Valo <kvalo@codeaurora.org>2017-05-24 16:45:32 +0300
commit6b81745e36e346e8aa936219d0311b384313bee3 (patch)
tree81caa2bf60cc39dc2f542aa6d4b026084547fb6c /drivers/net/wireless/ralink/rt2x00/rt2x00.h
parentlibertas: Remove function entry/exit debugging (diff)
downloadlinux-dev-6b81745e36e346e8aa936219d0311b384313bee3.tar.xz
linux-dev-6b81745e36e346e8aa936219d0311b384313bee3.zip
rt2x00: change function pointers for register accessors
This prepares the driver for changing all the 'read' register accessors to return the value instead of passing it by reference. Since a lot of them are used in callbacks, this takes care of the callbacks first, adding a couple of helpers that will be removed again one at a time. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ralink/rt2x00/rt2x00.h')
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2x00.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
index 1bc353eafe37..f2ae33bf2ef2 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -1056,6 +1056,13 @@ static inline void rt2x00_rf_read(struct rt2x00_dev *rt2x00dev,
*data = rt2x00dev->rf[word - 1];
}
+static inline u32 _rt2x00_rf_read(struct rt2x00_dev *rt2x00dev,
+ const unsigned int word)
+{
+ BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(u32));
+ return rt2x00dev->rf[word - 1];
+}
+
static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev,
const unsigned int word, u32 data)
{
@@ -1078,6 +1085,12 @@ static inline void rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
*data = le16_to_cpu(rt2x00dev->eeprom[word]);
}
+static inline u16 _rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
+ const unsigned int word)
+{
+ return le16_to_cpu(rt2x00dev->eeprom[word]);
+}
+
static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
const unsigned int word, u16 data)
{