aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-08-10 15:15:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 19:22:30 -0400
commitfad21bdf56a25e1cb3e92bba33349de368e8f0b0 (patch)
tree9a57267610a5cf039602557c02a4c5035635f5a2
parentfbf82fd2e1f4e679c60516d772d1862c941ca845 (diff)
[PATCH] USB: Fix regression in core/devio.c
This patch (as551) fixes another little problem recently added to the USB core. Someone didn't fix the type of the first argument to unregister_chrdev_region. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/core/devio.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index d12bc5e84a1a..56c082f34927 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -76,6 +76,8 @@ MODULE_PARM_DESC (usbfs_snoop, "true to log all usbfs traffic");
76 dev_info( dev , format , ## arg); \ 76 dev_info( dev , format , ## arg); \
77 } while (0) 77 } while (0)
78 78
79#define USB_DEVICE_DEV MKDEV(USB_DEVICE_MAJOR, 0)
80
79 81
80#define MAX_USBFS_BUFFER_SIZE 16384 82#define MAX_USBFS_BUFFER_SIZE 16384
81 83
@@ -1530,18 +1532,17 @@ int __init usbdev_init(void)
1530{ 1532{
1531 int retval; 1533 int retval;
1532 1534
1533 retval = register_chrdev_region(MKDEV(USB_DEVICE_MAJOR, 0), 1535 retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX,
1534 USB_DEVICE_MAX, "usb_device"); 1536 "usb_device");
1535 if (retval) { 1537 if (retval) {
1536 err("unable to register minors for usb_device"); 1538 err("unable to register minors for usb_device");
1537 goto out; 1539 goto out;
1538 } 1540 }
1539 cdev_init(&usb_device_cdev, &usbfs_device_file_operations); 1541 cdev_init(&usb_device_cdev, &usbfs_device_file_operations);
1540 retval = cdev_add(&usb_device_cdev, 1542 retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX);
1541 MKDEV(USB_DEVICE_MAJOR, 0), USB_DEVICE_MAX);
1542 if (retval) { 1543 if (retval) {
1543 err("unable to get usb_device major %d", USB_DEVICE_MAJOR); 1544 err("unable to get usb_device major %d", USB_DEVICE_MAJOR);
1544 unregister_chrdev_region(USB_DEVICE_MAJOR, USB_DEVICE_MAX); 1545 unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
1545 goto out; 1546 goto out;
1546 } 1547 }
1547 usb_device_class = class_create(THIS_MODULE, "usb_device"); 1548 usb_device_class = class_create(THIS_MODULE, "usb_device");
@@ -1550,7 +1551,7 @@ int __init usbdev_init(void)
1550 retval = PTR_ERR(usb_device_class); 1551 retval = PTR_ERR(usb_device_class);
1551 usb_device_class = NULL; 1552 usb_device_class = NULL;
1552 cdev_del(&usb_device_cdev); 1553 cdev_del(&usb_device_cdev);
1553 unregister_chrdev_region(USB_DEVICE_MAJOR, USB_DEVICE_MAX); 1554 unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
1554 } 1555 }
1555 1556
1556out: 1557out:
@@ -1561,6 +1562,6 @@ void usbdev_cleanup(void)
1561{ 1562{
1562 class_destroy(usb_device_class); 1563 class_destroy(usb_device_class);
1563 cdev_del(&usb_device_cdev); 1564 cdev_del(&usb_device_cdev);
1564 unregister_chrdev_region(USB_DEVICE_MAJOR, USB_DEVICE_MAX); 1565 unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
1565} 1566}
1566 1567