Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7943
b: refs/heads/master
c: fad21bd
h: refs/heads/master
i:
  7941: 55eacb2
  7939: 0953d14
  7935: b221087
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Sep 8, 2005
1 parent a805e26 commit 821b60d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fbf82fd2e1f4e679c60516d772d1862c941ca845
refs/heads/master: fad21bdf56a25e1cb3e92bba33349de368e8f0b0
15 changes: 8 additions & 7 deletions trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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");
Expand All @@ -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:
Expand All @@ -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);
}

0 comments on commit 821b60d

Please sign in to comment.