提交 f53510e8 编写于 作者: M Mariusz Kozlowski 提交者: Greg Kroah-Hartman

usb: legousbtower free kill urb cleanup

Hello,

- usb_free_urb() cleanup
- usb_kill_urb() cleanup
Signed-off-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 2891a51c
...@@ -317,12 +317,8 @@ static inline void tower_delete (struct lego_usb_tower *dev) ...@@ -317,12 +317,8 @@ static inline void tower_delete (struct lego_usb_tower *dev)
tower_abort_transfers (dev); tower_abort_transfers (dev);
/* free data structures */ /* free data structures */
if (dev->interrupt_in_urb != NULL) { usb_free_urb(dev->interrupt_in_urb);
usb_free_urb (dev->interrupt_in_urb); usb_free_urb(dev->interrupt_out_urb);
}
if (dev->interrupt_out_urb != NULL) {
usb_free_urb (dev->interrupt_out_urb);
}
kfree (dev->read_buffer); kfree (dev->read_buffer);
kfree (dev->interrupt_in_buffer); kfree (dev->interrupt_in_buffer);
kfree (dev->interrupt_out_buffer); kfree (dev->interrupt_out_buffer);
...@@ -502,15 +498,11 @@ static void tower_abort_transfers (struct lego_usb_tower *dev) ...@@ -502,15 +498,11 @@ static void tower_abort_transfers (struct lego_usb_tower *dev)
if (dev->interrupt_in_running) { if (dev->interrupt_in_running) {
dev->interrupt_in_running = 0; dev->interrupt_in_running = 0;
mb(); mb();
if (dev->interrupt_in_urb != NULL && dev->udev) { if (dev->udev)
usb_kill_urb (dev->interrupt_in_urb); usb_kill_urb (dev->interrupt_in_urb);
} }
} if (dev->interrupt_out_busy && dev->udev)
if (dev->interrupt_out_busy) { usb_kill_urb(dev->interrupt_out_urb);
if (dev->interrupt_out_urb != NULL && dev->udev) {
usb_kill_urb (dev->interrupt_out_urb);
}
}
exit: exit:
dbg(2, "%s: leave", __FUNCTION__); dbg(2, "%s: leave", __FUNCTION__);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册