ChangeSet 1.1337.3.4, 2003/10/09 10:46:05-07:00, greg@kroah.com [PATCH] USB: give legotower driver a real USB minor, and remove unneeded ioctl function. drivers/usb/misc/legousbtower.c | 38 ++++++-------------------------------- 1 files changed, 6 insertions(+), 32 deletions(-) diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c --- a/drivers/usb/misc/legousbtower.c Mon Dec 29 14:27:49 2003 +++ b/drivers/usb/misc/legousbtower.c Mon Dec 29 14:27:49 2003 @@ -88,13 +88,12 @@ MODULE_DEVICE_TABLE (usb, tower_table); -/* FIXME: Get a minor range for your devices from the usb maintainer */ -#define LEGO_USB_TOWER_MINOR_BASE 0xB3 +#define LEGO_USB_TOWER_MINOR_BASE 160 /* we can have up to this number of device plugged in at once */ #define MAX_DEVICES 16 -#define COMMAND_TIMEOUT (2*HZ) /* 60 second timeout for a command */ +#define COMMAND_TIMEOUT (2*HZ) /* 2 second timeout for a command */ /* Structure to hold all of our device specific stuff */ struct lego_usb_tower { @@ -130,7 +129,6 @@ /* local function prototypes */ static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t *ppos); static ssize_t tower_write (struct file *file, const char *buffer, size_t count, loff_t *ppos); -static int tower_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); static inline void tower_delete (struct lego_usb_tower *dev); static int tower_open (struct inode *inode, struct file *file); static int tower_release (struct inode *inode, struct file *file); @@ -151,7 +149,6 @@ .owner = THIS_MODULE, .read = tower_read, .write = tower_write, - .ioctl = tower_ioctl, .open = tower_open, .release = tower_release, }; @@ -212,15 +209,9 @@ if (dev->interrupt_out_urb != NULL) { usb_free_urb (dev->interrupt_out_urb); } - if (dev->read_buffer != NULL) { - kfree (dev->read_buffer); - } - if (dev->interrupt_in_buffer != NULL) { - kfree (dev->interrupt_in_buffer); - } - if (dev->interrupt_out_buffer != NULL) { - kfree (dev->interrupt_out_buffer); - } + kfree (dev->read_buffer); + kfree (dev->interrupt_in_buffer); + kfree (dev->interrupt_out_buffer); kfree (dev); dbg(2, "%s : leave", __func__); @@ -436,7 +427,6 @@ } if (signal_pending(current)) { - retval = -EINTR; goto exit; } @@ -505,7 +495,7 @@ /* verify that we actually have some data to write */ if (count == 0) { - dbg(1," %s : write request of 0 bytes", __func__); + dbg(1," %s : write request of 0 bytes", __func__); goto exit; } @@ -590,20 +580,6 @@ /** - * Number of reasons why this isn't supported - GKH doesn't like them - * since they are non-portable and also most of this is derived from - * proprietary information - */ - -static int tower_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - int retval = -ENOTTY; /* default: we don't understand ioctl */ - - return retval; -} - - -/** * tower_interrupt_in_callback */ static void tower_interrupt_in_callback (struct urb *urb, struct pt_regs *regs) @@ -778,8 +754,6 @@ err("Couldn't allocate interrupt_out_urb"); goto error; } - - /* initialize the devfs node for this device and register it */ /* we can register the device now, as it is ready */ usb_set_intfdata (interface, dev);