Commit a0cd1df9 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: legousbtower: clean up runaway white space

Drop space between function identifiers and opening parenthesis, which
was no longer even used consistently within the driver.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191105084152.16322-13-johan@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 72877248
...@@ -178,7 +178,7 @@ static const struct usb_device_id tower_table[] = { ...@@ -178,7 +178,7 @@ static const struct usb_device_id tower_table[] = {
{ } /* Terminating entry */ { } /* Terminating entry */
}; };
MODULE_DEVICE_TABLE (usb, tower_table); MODULE_DEVICE_TABLE(usb, tower_table);
#define LEGO_USB_TOWER_MINOR_BASE 160 #define LEGO_USB_TOWER_MINOR_BASE 160
...@@ -218,20 +218,20 @@ struct lego_usb_tower { ...@@ -218,20 +218,20 @@ struct lego_usb_tower {
/* local function prototypes */ /* local function prototypes */
static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, loff_t *ppos); static ssize_t tower_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos);
static ssize_t tower_write (struct file *file, const char __user *buffer, size_t count, loff_t *ppos); static ssize_t tower_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos);
static inline void tower_delete (struct lego_usb_tower *dev); static inline void tower_delete(struct lego_usb_tower *dev);
static int tower_open (struct inode *inode, struct file *file); static int tower_open(struct inode *inode, struct file *file);
static int tower_release (struct inode *inode, struct file *file); static int tower_release(struct inode *inode, struct file *file);
static __poll_t tower_poll (struct file *file, poll_table *wait); 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 loff_t tower_llseek(struct file *file, loff_t off, int whence);
static void tower_check_for_read_packet (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_in_callback(struct urb *urb);
static void tower_interrupt_out_callback (struct urb *urb); static void tower_interrupt_out_callback(struct urb *urb);
static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id); static int tower_probe(struct usb_interface *interface, const struct usb_device_id *id);
static void tower_disconnect (struct usb_interface *interface); static void tower_disconnect(struct usb_interface *interface);
/* file operations needed when we register this driver */ /* file operations needed when we register this driver */
...@@ -286,23 +286,23 @@ static inline void lego_usb_tower_debug_data(struct device *dev, ...@@ -286,23 +286,23 @@ static inline void lego_usb_tower_debug_data(struct device *dev,
/** /**
* tower_delete * tower_delete
*/ */
static inline void tower_delete (struct lego_usb_tower *dev) static inline void tower_delete(struct lego_usb_tower *dev)
{ {
/* free data structures */ /* free data structures */
usb_free_urb(dev->interrupt_in_urb); usb_free_urb(dev->interrupt_in_urb);
usb_free_urb(dev->interrupt_out_urb); 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);
usb_put_dev(dev->udev); usb_put_dev(dev->udev);
kfree (dev); kfree(dev);
} }
/** /**
* tower_open * tower_open
*/ */
static int tower_open (struct inode *inode, struct file *file) static int tower_open(struct inode *inode, struct file *file)
{ {
struct lego_usb_tower *dev = NULL; struct lego_usb_tower *dev = NULL;
int subminor; int subminor;
...@@ -321,7 +321,7 @@ static int tower_open (struct inode *inode, struct file *file) ...@@ -321,7 +321,7 @@ static int tower_open (struct inode *inode, struct file *file)
nonseekable_open(inode, file); nonseekable_open(inode, file);
subminor = iminor(inode); subminor = iminor(inode);
interface = usb_find_interface (&tower_driver, subminor); interface = usb_find_interface(&tower_driver, subminor);
if (!interface) { if (!interface) {
pr_err("error, can't find device for minor %d\n", subminor); pr_err("error, can't find device for minor %d\n", subminor);
...@@ -349,15 +349,15 @@ static int tower_open (struct inode *inode, struct file *file) ...@@ -349,15 +349,15 @@ static int tower_open (struct inode *inode, struct file *file)
} }
/* reset the tower */ /* reset the tower */
result = usb_control_msg (dev->udev, result = usb_control_msg(dev->udev,
usb_rcvctrlpipe(dev->udev, 0), usb_rcvctrlpipe(dev->udev, 0),
LEGO_USB_TOWER_REQUEST_RESET, LEGO_USB_TOWER_REQUEST_RESET,
USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE, USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE,
0, 0,
0, 0,
reset_reply, reset_reply,
sizeof(*reset_reply), sizeof(*reset_reply),
1000); 1000);
if (result < 0) { if (result < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->udev->dev,
"LEGO USB Tower reset control request failed\n"); "LEGO USB Tower reset control request failed\n");
...@@ -368,19 +368,19 @@ static int tower_open (struct inode *inode, struct file *file) ...@@ -368,19 +368,19 @@ static int tower_open (struct inode *inode, struct file *file)
/* initialize in direction */ /* initialize in direction */
dev->read_buffer_length = 0; dev->read_buffer_length = 0;
dev->read_packet_length = 0; dev->read_packet_length = 0;
usb_fill_int_urb (dev->interrupt_in_urb, usb_fill_int_urb(dev->interrupt_in_urb,
dev->udev, dev->udev,
usb_rcvintpipe(dev->udev, dev->interrupt_in_endpoint->bEndpointAddress), usb_rcvintpipe(dev->udev, dev->interrupt_in_endpoint->bEndpointAddress),
dev->interrupt_in_buffer, dev->interrupt_in_buffer,
usb_endpoint_maxp(dev->interrupt_in_endpoint), usb_endpoint_maxp(dev->interrupt_in_endpoint),
tower_interrupt_in_callback, tower_interrupt_in_callback,
dev, dev,
dev->interrupt_in_interval); dev->interrupt_in_interval);
dev->interrupt_in_done = 0; dev->interrupt_in_done = 0;
mb(); mb();
retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL); retval = usb_submit_urb(dev->interrupt_in_urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(&dev->udev->dev, dev_err(&dev->udev->dev,
"Couldn't submit interrupt_in_urb %d\n", retval); "Couldn't submit interrupt_in_urb %d\n", retval);
...@@ -403,7 +403,7 @@ static int tower_open (struct inode *inode, struct file *file) ...@@ -403,7 +403,7 @@ static int tower_open (struct inode *inode, struct file *file)
/** /**
* tower_release * tower_release
*/ */
static int tower_release (struct inode *inode, struct file *file) static int tower_release(struct inode *inode, struct file *file)
{ {
struct lego_usb_tower *dev; struct lego_usb_tower *dev;
int retval = 0; int retval = 0;
...@@ -422,13 +422,14 @@ static int tower_release (struct inode *inode, struct file *file) ...@@ -422,13 +422,14 @@ static int tower_release (struct inode *inode, struct file *file)
/* unlock here as tower_delete frees dev */ /* unlock here as tower_delete frees dev */
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
tower_delete (dev); tower_delete(dev);
goto exit; goto exit;
} }
/* wait until write transfer is finished */ /* wait until write transfer is finished */
if (dev->interrupt_out_busy) { if (dev->interrupt_out_busy) {
wait_event_interruptible_timeout (dev->write_wait, !dev->interrupt_out_busy, 2 * HZ); wait_event_interruptible_timeout(dev->write_wait, !dev->interrupt_out_busy,
2 * HZ);
} }
/* shutdown transfers */ /* shutdown transfers */
...@@ -450,23 +451,23 @@ static int tower_release (struct inode *inode, struct file *file) ...@@ -450,23 +451,23 @@ static int tower_release (struct inode *inode, struct file *file)
* until it has been there unchanged for at least * until it has been there unchanged for at least
* dev->packet_timeout_jiffies, or until the buffer is full. * dev->packet_timeout_jiffies, or until the buffer is full.
*/ */
static void tower_check_for_read_packet (struct lego_usb_tower *dev) static void tower_check_for_read_packet(struct lego_usb_tower *dev)
{ {
spin_lock_irq (&dev->read_buffer_lock); spin_lock_irq(&dev->read_buffer_lock);
if (!packet_timeout if (!packet_timeout
|| time_after(jiffies, dev->read_last_arrival + dev->packet_timeout_jiffies) || time_after(jiffies, dev->read_last_arrival + dev->packet_timeout_jiffies)
|| dev->read_buffer_length == read_buffer_size) { || dev->read_buffer_length == read_buffer_size) {
dev->read_packet_length = dev->read_buffer_length; dev->read_packet_length = dev->read_buffer_length;
} }
dev->interrupt_in_done = 0; dev->interrupt_in_done = 0;
spin_unlock_irq (&dev->read_buffer_lock); spin_unlock_irq(&dev->read_buffer_lock);
} }
/** /**
* tower_poll * tower_poll
*/ */
static __poll_t tower_poll (struct file *file, poll_table *wait) static __poll_t tower_poll(struct file *file, poll_table *wait)
{ {
struct lego_usb_tower *dev; struct lego_usb_tower *dev;
__poll_t mask = 0; __poll_t mask = 0;
...@@ -494,7 +495,7 @@ static __poll_t tower_poll (struct file *file, poll_table *wait) ...@@ -494,7 +495,7 @@ static __poll_t tower_poll (struct file *file, poll_table *wait)
/** /**
* tower_llseek * tower_llseek
*/ */
static loff_t tower_llseek (struct file *file, loff_t off, int whence) static loff_t tower_llseek(struct file *file, loff_t off, int whence)
{ {
return -ESPIPE; /* unseekable */ return -ESPIPE; /* unseekable */
} }
...@@ -503,7 +504,7 @@ static loff_t tower_llseek (struct file *file, loff_t off, int whence) ...@@ -503,7 +504,7 @@ static loff_t tower_llseek (struct file *file, loff_t off, int whence)
/** /**
* tower_read * tower_read
*/ */
static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, loff_t *ppos) static ssize_t tower_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{ {
struct lego_usb_tower *dev; struct lego_usb_tower *dev;
size_t bytes_to_read; size_t bytes_to_read;
...@@ -536,7 +537,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, ...@@ -536,7 +537,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
} }
/* wait for data */ /* wait for data */
tower_check_for_read_packet (dev); tower_check_for_read_packet(dev);
while (dev->read_packet_length == 0) { while (dev->read_packet_length == 0) {
if (file->f_flags & O_NONBLOCK) { if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN; retval = -EAGAIN;
...@@ -553,28 +554,28 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, ...@@ -553,28 +554,28 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
timeout = jiffies + msecs_to_jiffies(read_timeout); timeout = jiffies + msecs_to_jiffies(read_timeout);
} }
/* check for read timeout */ /* check for read timeout */
if (read_timeout && time_after (jiffies, timeout)) { if (read_timeout && time_after(jiffies, timeout)) {
retval = -ETIMEDOUT; retval = -ETIMEDOUT;
goto unlock_exit; goto unlock_exit;
} }
tower_check_for_read_packet (dev); tower_check_for_read_packet(dev);
} }
/* copy the data from read_buffer into userspace */ /* copy the data from read_buffer into userspace */
bytes_to_read = min(count, dev->read_packet_length); bytes_to_read = min(count, dev->read_packet_length);
if (copy_to_user (buffer, dev->read_buffer, bytes_to_read)) { if (copy_to_user(buffer, dev->read_buffer, bytes_to_read)) {
retval = -EFAULT; retval = -EFAULT;
goto unlock_exit; goto unlock_exit;
} }
spin_lock_irq (&dev->read_buffer_lock); spin_lock_irq(&dev->read_buffer_lock);
dev->read_buffer_length -= bytes_to_read; dev->read_buffer_length -= bytes_to_read;
dev->read_packet_length -= bytes_to_read; dev->read_packet_length -= bytes_to_read;
for (i=0; i<dev->read_buffer_length; i++) { for (i=0; i<dev->read_buffer_length; i++) {
dev->read_buffer[i] = dev->read_buffer[i+bytes_to_read]; dev->read_buffer[i] = dev->read_buffer[i+bytes_to_read];
} }
spin_unlock_irq (&dev->read_buffer_lock); spin_unlock_irq(&dev->read_buffer_lock);
retval = bytes_to_read; retval = bytes_to_read;
...@@ -590,7 +591,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count, ...@@ -590,7 +591,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
/** /**
* tower_write * tower_write
*/ */
static ssize_t tower_write (struct file *file, const char __user *buffer, size_t count, loff_t *ppos) static ssize_t tower_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{ {
struct lego_usb_tower *dev; struct lego_usb_tower *dev;
size_t bytes_to_write; size_t bytes_to_write;
...@@ -622,7 +623,8 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t ...@@ -622,7 +623,8 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
retval = -EAGAIN; retval = -EAGAIN;
goto unlock_exit; goto unlock_exit;
} }
retval = wait_event_interruptible (dev->write_wait, !dev->interrupt_out_busy); retval = wait_event_interruptible(dev->write_wait,
!dev->interrupt_out_busy);
if (retval) { if (retval) {
goto unlock_exit; goto unlock_exit;
} }
...@@ -633,7 +635,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t ...@@ -633,7 +635,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
dev_dbg(&dev->udev->dev, "%s: count = %zd, bytes_to_write = %zd\n", dev_dbg(&dev->udev->dev, "%s: count = %zd, bytes_to_write = %zd\n",
__func__, count, bytes_to_write); __func__, count, bytes_to_write);
if (copy_from_user (dev->interrupt_out_buffer, buffer, bytes_to_write)) { if (copy_from_user(dev->interrupt_out_buffer, buffer, bytes_to_write)) {
retval = -EFAULT; retval = -EFAULT;
goto unlock_exit; goto unlock_exit;
} }
...@@ -651,7 +653,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t ...@@ -651,7 +653,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
dev->interrupt_out_busy = 1; dev->interrupt_out_busy = 1;
wmb(); wmb();
retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL); retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL);
if (retval) { if (retval) {
dev->interrupt_out_busy = 0; dev->interrupt_out_busy = 0;
dev_err(&dev->udev->dev, dev_err(&dev->udev->dev,
...@@ -672,7 +674,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t ...@@ -672,7 +674,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
/** /**
* tower_interrupt_in_callback * tower_interrupt_in_callback
*/ */
static void tower_interrupt_in_callback (struct urb *urb) static void tower_interrupt_in_callback(struct urb *urb)
{ {
struct lego_usb_tower *dev = urb->context; struct lego_usb_tower *dev = urb->context;
int status = urb->status; int status = urb->status;
...@@ -698,9 +700,9 @@ static void tower_interrupt_in_callback (struct urb *urb) ...@@ -698,9 +700,9 @@ static void tower_interrupt_in_callback (struct urb *urb)
if (urb->actual_length > 0) { if (urb->actual_length > 0) {
spin_lock_irqsave(&dev->read_buffer_lock, flags); spin_lock_irqsave(&dev->read_buffer_lock, flags);
if (dev->read_buffer_length + urb->actual_length < read_buffer_size) { if (dev->read_buffer_length + urb->actual_length < read_buffer_size) {
memcpy (dev->read_buffer + dev->read_buffer_length, memcpy(dev->read_buffer + dev->read_buffer_length,
dev->interrupt_in_buffer, dev->interrupt_in_buffer,
urb->actual_length); urb->actual_length);
dev->read_buffer_length += urb->actual_length; dev->read_buffer_length += urb->actual_length;
dev->read_last_arrival = jiffies; dev->read_last_arrival = jiffies;
dev_dbg(&dev->udev->dev, "%s: received %d bytes\n", dev_dbg(&dev->udev->dev, "%s: received %d bytes\n",
...@@ -720,14 +722,14 @@ static void tower_interrupt_in_callback (struct urb *urb) ...@@ -720,14 +722,14 @@ static void tower_interrupt_in_callback (struct urb *urb)
} }
exit: exit:
dev->interrupt_in_done = 1; dev->interrupt_in_done = 1;
wake_up_interruptible (&dev->read_wait); wake_up_interruptible(&dev->read_wait);
} }
/** /**
* tower_interrupt_out_callback * tower_interrupt_out_callback
*/ */
static void tower_interrupt_out_callback (struct urb *urb) static void tower_interrupt_out_callback(struct urb *urb)
{ {
struct lego_usb_tower *dev = urb->context; struct lego_usb_tower *dev = urb->context;
int status = urb->status; int status = urb->status;
...@@ -755,7 +757,7 @@ static void tower_interrupt_out_callback (struct urb *urb) ...@@ -755,7 +757,7 @@ static void tower_interrupt_out_callback (struct urb *urb)
* Called by the usb core when a new device is connected that it thinks * Called by the usb core when a new device is connected that it thinks
* this driver might be interested in. * this driver might be interested in.
*/ */
static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id) static int tower_probe(struct usb_interface *interface, const struct usb_device_id *id)
{ {
struct device *idev = &interface->dev; struct device *idev = &interface->dev;
struct usb_device *udev = interface_to_usbdev(interface); struct usb_device *udev = interface_to_usbdev(interface);
...@@ -771,11 +773,11 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device ...@@ -771,11 +773,11 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
mutex_init(&dev->lock); mutex_init(&dev->lock);
dev->udev = usb_get_dev(udev); dev->udev = usb_get_dev(udev);
spin_lock_init (&dev->read_buffer_lock); spin_lock_init(&dev->read_buffer_lock);
dev->packet_timeout_jiffies = msecs_to_jiffies(packet_timeout); dev->packet_timeout_jiffies = msecs_to_jiffies(packet_timeout);
dev->read_last_arrival = jiffies; dev->read_last_arrival = jiffies;
init_waitqueue_head (&dev->read_wait); init_waitqueue_head(&dev->read_wait);
init_waitqueue_head (&dev->write_wait); init_waitqueue_head(&dev->write_wait);
result = usb_find_common_endpoints_reverse(interface->cur_altsetting, result = usb_find_common_endpoints_reverse(interface->cur_altsetting,
NULL, NULL, NULL, NULL,
...@@ -787,16 +789,16 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device ...@@ -787,16 +789,16 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
goto error; goto error;
} }
dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL); dev->read_buffer = kmalloc(read_buffer_size, GFP_KERNEL);
if (!dev->read_buffer) if (!dev->read_buffer)
goto error; goto error;
dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL); dev->interrupt_in_buffer = kmalloc(usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL);
if (!dev->interrupt_in_buffer) if (!dev->interrupt_in_buffer)
goto error; goto error;
dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->interrupt_in_urb) if (!dev->interrupt_in_urb)
goto error; goto error;
dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL); dev->interrupt_out_buffer = kmalloc(write_buffer_size, GFP_KERNEL);
if (!dev->interrupt_out_buffer) if (!dev->interrupt_out_buffer)
goto error; goto error;
dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL);
...@@ -813,15 +815,15 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device ...@@ -813,15 +815,15 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
} }
/* get the firmware version and log it */ /* get the firmware version and log it */
result = usb_control_msg (udev, result = usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0), usb_rcvctrlpipe(udev, 0),
LEGO_USB_TOWER_REQUEST_GET_VERSION, LEGO_USB_TOWER_REQUEST_GET_VERSION,
USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE, USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE,
0, 0,
0, 0,
get_version_reply, get_version_reply,
sizeof(*get_version_reply), sizeof(*get_version_reply),
1000); 1000);
if (result != sizeof(*get_version_reply)) { if (result != sizeof(*get_version_reply)) {
if (result >= 0) if (result >= 0)
result = -EIO; result = -EIO;
...@@ -836,9 +838,9 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device ...@@ -836,9 +838,9 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
le16_to_cpu(get_version_reply->build_no)); le16_to_cpu(get_version_reply->build_no));
/* we can register the device now, as it is ready */ /* we can register the device now, as it is ready */
usb_set_intfdata (interface, dev); usb_set_intfdata(interface, dev);
retval = usb_register_dev (interface, &tower_class); retval = usb_register_dev(interface, &tower_class);
if (retval) { if (retval) {
/* something prevented us from registering this driver */ /* something prevented us from registering this driver */
...@@ -868,17 +870,17 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device ...@@ -868,17 +870,17 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
* *
* Called by the usb core when the device is removed from the system. * Called by the usb core when the device is removed from the system.
*/ */
static void tower_disconnect (struct usb_interface *interface) static void tower_disconnect(struct usb_interface *interface)
{ {
struct lego_usb_tower *dev; struct lego_usb_tower *dev;
int minor; int minor;
dev = usb_get_intfdata (interface); dev = usb_get_intfdata(interface);
minor = dev->minor; minor = dev->minor;
/* give back our minor and prevent further open() */ /* give back our minor and prevent further open() */
usb_deregister_dev (interface, &tower_class); usb_deregister_dev(interface, &tower_class);
/* stop I/O */ /* stop I/O */
usb_poison_urb(dev->interrupt_in_urb); usb_poison_urb(dev->interrupt_in_urb);
...@@ -889,7 +891,7 @@ static void tower_disconnect (struct usb_interface *interface) ...@@ -889,7 +891,7 @@ static void tower_disconnect (struct usb_interface *interface)
/* if the device is not opened, then we clean up right now */ /* if the device is not opened, then we clean up right now */
if (!dev->open_count) { if (!dev->open_count) {
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
tower_delete (dev); tower_delete(dev);
} else { } else {
dev->disconnected = 1; dev->disconnected = 1;
/* wake up pollers */ /* wake up pollers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment