aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index cb208d589ff8..39e1052123e3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -170,19 +170,22 @@ struct rt2x00_async_read_data {
170 __le32 reg; 170 __le32 reg;
171 struct usb_ctrlrequest cr; 171 struct usb_ctrlrequest cr;
172 struct rt2x00_dev *rt2x00dev; 172 struct rt2x00_dev *rt2x00dev;
173 void (*callback)(struct rt2x00_dev *,int,u32); 173 bool (*callback)(struct rt2x00_dev *, int, u32);
174}; 174};
175 175
176static void rt2x00usb_register_read_async_cb(struct urb *urb) 176static void rt2x00usb_register_read_async_cb(struct urb *urb)
177{ 177{
178 struct rt2x00_async_read_data *rd = urb->context; 178 struct rt2x00_async_read_data *rd = urb->context;
179 rd->callback(rd->rt2x00dev, urb->status, le32_to_cpu(rd->reg)); 179 if (rd->callback(rd->rt2x00dev, urb->status, le32_to_cpu(rd->reg))) {
180 kfree(urb->context); 180 if (usb_submit_urb(urb, GFP_ATOMIC) < 0)
181 kfree(rd);
182 } else
183 kfree(rd);
181} 184}
182 185
183void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev, 186void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev,
184 const unsigned int offset, 187 const unsigned int offset,
185 void (*callback)(struct rt2x00_dev*,int,u32)) 188 bool (*callback)(struct rt2x00_dev*, int, u32))
186{ 189{
187 struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev); 190 struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
188 struct urb *urb; 191 struct urb *urb;