diff options
author | Johan Hovold <johan@kernel.org> | 2019-11-05 09:41:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-07 11:17:52 +0100 |
commit | aa6f3832458dab256f17f451e00270ae3f5736e4 (patch) | |
tree | 653fb17035ca03da5911f4709ebec2683a596ed6 /drivers/usb/misc/legousbtower.c | |
parent | bafd1b1c2cee5513a400efffa58e9d02d8577423 (diff) |
USB: legousbtower: remove tower_abort_transfers()
Drop the tower_abort_transfers() function which is now only called from
release and instead explicitly kill the two URBs.
This incidentally also fixes the outdated comment about freeing memory.
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191105084152.16322-9-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/legousbtower.c')
-rw-r--r-- | drivers/usb/misc/legousbtower.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index 3e409dfe172c..f85b6ed2fb8b 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -226,7 +226,6 @@ static int tower_release (struct inode *inode, struct file *file); static __poll_t tower_poll (struct file *file, poll_table *wait); static loff_t tower_llseek (struct file *file, loff_t off, int whence); -static void tower_abort_transfers (struct lego_usb_tower *dev); static void tower_check_for_read_packet (struct lego_usb_tower *dev); static void tower_interrupt_in_callback (struct urb *urb); static void tower_interrupt_out_callback (struct urb *urb); @@ -431,7 +430,11 @@ static int tower_release (struct inode *inode, struct file *file) if (dev->interrupt_out_busy) { wait_event_interruptible_timeout (dev->write_wait, !dev->interrupt_out_busy, 2 * HZ); } - tower_abort_transfers (dev); + + /* shutdown transfers */ + usb_kill_urb(dev->interrupt_in_urb); + usb_kill_urb(dev->interrupt_out_urb); + dev->open_count = 0; mutex_unlock(&dev->lock); @@ -439,19 +442,6 @@ exit: return retval; } - -/** - * tower_abort_transfers - * aborts transfers and frees associated data structures - */ -static void tower_abort_transfers (struct lego_usb_tower *dev) -{ - /* shutdown transfer */ - usb_kill_urb(dev->interrupt_in_urb); - usb_kill_urb(dev->interrupt_out_urb); -} - - /** * tower_check_for_read_packet * |