USB: dynamically allocate usb_device children pointers instead of using a fix array

Non-hub device has no child, and even a real USB hub has ports far
less than USB_MAXCHILDREN, so there is no need using a fix array for
child devices, just allocate it dynamically according real port
number.

Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Huajun Li
2012-03-12 21:00:19 +08:00
committed by Greg Kroah-Hartman
parent 90221170bf
commit 8816230e13
2 changed files with 8 additions and 4 deletions

View File

@@ -501,7 +501,7 @@ struct usb_device {
#endif
int maxchild;
struct usb_device *children[USB_MAXCHILDREN];
struct usb_device **children;
u32 quirks;
atomic_t urbnum;