Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10804
b: refs/heads/master
c: 4592bf5
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 28, 2005
1 parent 8360656 commit 94b5960
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 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: 3e8a556a02d5aa16375d4d74aad0f67cd844c047
refs/heads/master: 4592bf5a22593704bb9e8c584a81bf6ca4f6cfec
34 changes: 17 additions & 17 deletions trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,23 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig
return ret;
}

static struct usb_device *usbdev_lookup_minor(int minor)
{
struct class_device *class_dev;
struct usb_device *dev = NULL;

down(&usb_device_class->sem);
list_for_each_entry(class_dev, &usb_device_class->children, node) {
if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
dev = class_dev->class_data;
break;
}
}
up(&usb_device_class->sem);

return dev;
};

/*
* file operations
*/
Expand Down Expand Up @@ -1533,23 +1550,6 @@ struct file_operations usbfs_device_file_operations = {
.release = usbdev_release,
};

struct usb_device *usbdev_lookup_minor(int minor)
{
struct class_device *class_dev;
struct usb_device *dev = NULL;

down(&usb_device_class->sem);
list_for_each_entry(class_dev, &usb_device_class->children, node) {
if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
dev = class_dev->class_data;
break;
}
}
up(&usb_device_class->sem);

return dev;
};

void usbdev_add(struct usb_device *dev)
{
int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/core/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ extern int usbdev_init(void);
extern void usbdev_cleanup(void);
extern void usbdev_add(struct usb_device *dev);
extern void usbdev_remove(struct usb_device *dev);
extern struct usb_device *usbdev_lookup_minor(int minor);

struct dev_state {
struct list_head list; /* state list */
Expand Down

0 comments on commit 94b5960

Please sign in to comment.