diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-05-17 16:46:53 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-05-24 16:45:32 +0300 |
commit | 6b81745e36e346e8aa936219d0311b384313bee3 (patch) | |
tree | 81caa2bf60cc39dc2f542aa6d4b026084547fb6c /drivers/net/wireless/ralink/rt2x00/rt2x00usb.h | |
parent | 4bc606af9fab7d5e3c6f2a333b290f9dce89c19a (diff) |
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/rt2x00usb.h')
-rw-r--r-- | drivers/net/wireless/ralink/rt2x00/rt2x00usb.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.h b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.h index 569363da00a2..4cad1beec791 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.h +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.h @@ -206,6 +206,16 @@ static inline void rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, *value = le32_to_cpu(reg); } +static inline u32 _rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, + const unsigned int offset) +{ + __le32 reg = 0; + rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ, + USB_VENDOR_REQUEST_IN, offset, + ®, sizeof(reg)); + return le32_to_cpu(reg); +} + /** * rt2x00usb_register_read_lock - Read 32bit register word * @rt2x00dev: Device pointer, see &struct rt2x00_dev. @@ -216,7 +226,7 @@ static inline void rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, * through rt2x00usb_vendor_req_buff_lock(). */ static inline void rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, + const unsigned int offset, u32 *value) { __le32 reg = 0; @@ -226,6 +236,16 @@ static inline void rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, *value = le32_to_cpu(reg); } +static inline u32 _rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, + const unsigned int offset) +{ + __le32 reg = 0; + rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_READ, + USB_VENDOR_REQUEST_IN, offset, + ®, sizeof(reg), REGISTER_TIMEOUT); + return le32_to_cpu(reg); +} + /** * rt2x00usb_register_multiread - Read 32bit register words * @rt2x00dev: Device pointer, see &struct rt2x00_dev. |