/*
* usb class driver info in order to get a minor number from the usb core,
- * and to have the device registered with devfs and the driver core
+ * and to have the device registered with the driver core
*/
static struct usb_class_driver tower_class = {
- .name = "usb/legousbtower%d",
+ .name = "legousbtower%d",
.fops = &tower_fops,
- .mode = S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH,
.minor_base = LEGO_USB_TOWER_MINOR_BASE,
};
/* usb specific object needed to register this driver with the usb subsystem */
static struct usb_driver tower_driver = {
- .owner = THIS_MODULE,
.name = "legousbtower",
.probe = tower_probe,
.disconnect = tower_disconnect,
0,
&reset_reply,
sizeof(reset_reply),
- HZ);
+ 1000);
if (result < 0) {
err("LEGO USB Tower reset control request failed");
retval = result;
dev->udev,
usb_rcvintpipe(dev->udev, dev->interrupt_in_endpoint->bEndpointAddress),
dev->interrupt_in_buffer,
- dev->interrupt_in_endpoint->wMaxPacketSize,
+ le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize),
tower_interrupt_in_callback,
dev,
dev->interrupt_in_interval);
info ("udev is NULL.");
}
- /* See if the device offered us matches what we can accept */
- if ((udev->descriptor.idVendor != LEGO_USB_TOWER_VENDOR_ID) ||
- (udev->descriptor.idProduct != LEGO_USB_TOWER_PRODUCT_ID)) {
- return -ENODEV;
- }
-
-
- /* allocate memory for our device state and intialize it */
+ /* allocate memory for our device state and initialize it */
dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL);
err("Couldn't allocate read_buffer");
goto error;
}
- dev->interrupt_in_buffer = kmalloc (dev->interrupt_in_endpoint->wMaxPacketSize, GFP_KERNEL);
+ dev->interrupt_in_buffer = kmalloc (le16_to_cpu(dev->interrupt_in_endpoint->wMaxPacketSize), GFP_KERNEL);
if (!dev->interrupt_in_buffer) {
err("Couldn't allocate interrupt_in_buffer");
goto error;
0,
&get_version_reply,
sizeof(get_version_reply),
- HZ);
+ 1000);
if (result < 0) {
err("LEGO USB Tower get version control request failed");
retval = result;