Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104618
b: refs/heads/master
c: e04199b
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent 04769eb commit 7684e7b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 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: d64aac36394b3c26db53538bfedd8444a3a2206e
refs/heads/master: e04199b2167e88f0e2d0410fafaa2c35ff7ba8c1
19 changes: 10 additions & 9 deletions trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1726,20 +1726,21 @@ static struct class *usb_classdev_class;

static int usb_classdev_add(struct usb_device *dev)
{
int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);

dev->usb_classdev = device_create(usb_classdev_class, &dev->dev,
MKDEV(USB_DEVICE_MAJOR, minor),
"usbdev%d.%d", dev->bus->busnum, dev->devnum);
if (IS_ERR(dev->usb_classdev))
return PTR_ERR(dev->usb_classdev);

struct device *cldev;

cldev = device_create(usb_classdev_class, &dev->dev, dev->dev.devt,
"usbdev%d.%d", dev->bus->busnum,
dev->devnum);
if (IS_ERR(cldev))
return PTR_ERR(cldev);
dev->usb_classdev = cldev;
return 0;
}

static void usb_classdev_remove(struct usb_device *dev)
{
device_unregister(dev->usb_classdev);
if (dev->usb_classdev)
device_unregister(dev->usb_classdev);
usb_fs_classdev_common_remove(dev);
}

Expand Down

0 comments on commit 7684e7b

Please sign in to comment.