aboutsummaryrefslogtreecommitdiff
path: root/drivers
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 16:22:30 -0700
commitfad21bdf56a25e1cb3e92bba33349de368e8f0b0 (patch)
tree9a57267610a5cf039602557c02a4c5035635f5a2 /drivers
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>
Diffstat (limited to 'drivers')
-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 d12bc5e84a1..56c082f3492 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");
dev_info( dev , format , ## arg); \
} while (0)
+#define USB_DEVICE_DEV MKDEV(USB_DEVICE_MAJOR, 0)
+
#define MAX_USBFS_BUFFER_SIZE 16384
@@ -1530,18 +1532,17 @@ int __init usbdev_init(void)
{
int retval;
- retval = register_chrdev_region(MKDEV(USB_DEVICE_MAJOR, 0),
- USB_DEVICE_MAX, "usb_device");
+ retval = register_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX,
+ "usb_device");
if (retval) {
err("unable to register minors for usb_device");
goto out;
}
cdev_init(&usb_device_cdev, &usbfs_device_file_operations);
- retval = cdev_add(&usb_device_cdev,
- MKDEV(USB_DEVICE_MAJOR, 0), USB_DEVICE_MAX);
+ retval = cdev_add(&usb_device_cdev, USB_DEVICE_DEV, USB_DEVICE_MAX);
if (retval) {
err("unable to get usb_device major %d", USB_DEVICE_MAJOR);
- unregister_chrdev_region(USB_DEVICE_MAJOR, USB_DEVICE_MAX);
+ unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
goto out;
}
usb_device_class = class_create(THIS_MODULE, "usb_device");
@@ -1550,7 +1551,7 @@ int __init usbdev_init(void)
retval = PTR_ERR(usb_device_class);
usb_device_class = NULL;
cdev_del(&usb_device_cdev);
- unregister_chrdev_region(USB_DEVICE_MAJOR, USB_DEVICE_MAX);
+ unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
}
out:
@@ -1561,6 +1562,6 @@ void usbdev_cleanup(void)
{
class_destroy(usb_device_class);
cdev_del(&usb_device_cdev);
- unregister_chrdev_region(USB_DEVICE_MAJOR, USB_DEVICE_MAX);
+ unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
}