Commit a6de029b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: give legotower driver a real USB minor, and remove unneeded ioctl function.

parent eb0ebaf6
...@@ -88,13 +88,12 @@ static struct usb_device_id tower_table [] = { ...@@ -88,13 +88,12 @@ static struct usb_device_id tower_table [] = {
MODULE_DEVICE_TABLE (usb, tower_table); MODULE_DEVICE_TABLE (usb, tower_table);
/* FIXME: Get a minor range for your devices from the usb maintainer */ #define LEGO_USB_TOWER_MINOR_BASE 160
#define LEGO_USB_TOWER_MINOR_BASE 0xB3
/* we can have up to this number of device plugged in at once */ /* we can have up to this number of device plugged in at once */
#define MAX_DEVICES 16 #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 */ /* Structure to hold all of our device specific stuff */
struct lego_usb_tower { struct lego_usb_tower {
...@@ -130,7 +129,6 @@ struct lego_usb_tower { ...@@ -130,7 +129,6 @@ struct lego_usb_tower {
/* local function prototypes */ /* local function prototypes */
static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t *ppos); 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 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 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);
...@@ -151,7 +149,6 @@ static struct file_operations tower_fops = { ...@@ -151,7 +149,6 @@ static struct file_operations tower_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = tower_read, .read = tower_read,
.write = tower_write, .write = tower_write,
.ioctl = tower_ioctl,
.open = tower_open, .open = tower_open,
.release = tower_release, .release = tower_release,
}; };
...@@ -212,15 +209,9 @@ static inline void tower_delete (struct lego_usb_tower *dev) ...@@ -212,15 +209,9 @@ static inline void tower_delete (struct lego_usb_tower *dev)
if (dev->interrupt_out_urb != NULL) { if (dev->interrupt_out_urb != NULL) {
usb_free_urb (dev->interrupt_out_urb); usb_free_urb (dev->interrupt_out_urb);
} }
if (dev->read_buffer != NULL) {
kfree (dev->read_buffer); kfree (dev->read_buffer);
}
if (dev->interrupt_in_buffer != NULL) {
kfree (dev->interrupt_in_buffer); kfree (dev->interrupt_in_buffer);
}
if (dev->interrupt_out_buffer != NULL) {
kfree (dev->interrupt_out_buffer); kfree (dev->interrupt_out_buffer);
}
kfree (dev); kfree (dev);
dbg(2, "%s : leave", __func__); dbg(2, "%s : leave", __func__);
...@@ -436,7 +427,6 @@ static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t ...@@ -436,7 +427,6 @@ static ssize_t tower_read (struct file *file, char *buffer, size_t count, loff_t
} }
if (signal_pending(current)) { if (signal_pending(current)) {
retval = -EINTR; retval = -EINTR;
goto exit; goto exit;
} }
...@@ -589,20 +579,6 @@ static ssize_t tower_write (struct file *file, const char *buffer, size_t count, ...@@ -589,20 +579,6 @@ static ssize_t tower_write (struct file *file, const char *buffer, size_t count,
} }
/**
* 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 * tower_interrupt_in_callback
*/ */
...@@ -779,8 +755,6 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device ...@@ -779,8 +755,6 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
goto error; goto error;
} }
/* initialize the devfs node for this device and register it */
/* 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);
......
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