]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
USB: legousbtower: remove tower_abort_transfers()
authorJohan Hovold <johan@kernel.org>
Tue, 5 Nov 2019 08:41:46 +0000 (09:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Nov 2019 10:17:52 +0000 (11:17 +0100)
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>
drivers/usb/misc/legousbtower.c

index 3e409dfe172c09ce3a43602bb86e52f77b26d443..f85b6ed2fb8bd83c8347cf518ae44aac899b5685 100644 (file)
@@ -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 @@ static int tower_release (struct inode *inode, struct file *file)
        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
  *