Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 11:40:25AM +0200, Johan Hovold wrote: > On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: > > From: Greg Kroah-Hartman > > [...] > > > --- a/drivers/usb/serial/usb-serial.c > > +++ b/drivers/usb/serial/usb-serial.c > > @@ -37,6 +37,7 @@ > > #include > >

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 12:00:47PM +0200, Johan Hovold wrote: > On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: > > From: Greg Kroah-Hartman > > > @@ -1040,11 +1044,10 @@ static int usb_serial_probe(struct usb_i > > */ > > serial->disconnected = 1; > > > > - if

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: > From: Greg Kroah-Hartman > @@ -1040,11 +1044,10 @@ static int usb_serial_probe(struct usb_i >*/ > serial->disconnected = 1; > > - if (get_free_serial(serial, num_ports, ) == NULL) { > + if (get_free_serial(serial,

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Fri, Jun 07, 2013 at 11:40:25AM +0200, Johan Hovold wrote: > On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: > > From: Greg Kroah-Hartman > > [...] > > > /* Functions needed by other parts of the usbserial core */ > > -extern struct usb_serial *usb_serial_get_by_index(unsigned int

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: > From: Greg Kroah-Hartman [...] > --- a/drivers/usb/serial/usb-serial.c > +++ b/drivers/usb/serial/usb-serial.c > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > #include "pl2303.h" > > #define DRIVER_AUTHOR

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 12:00:47PM +0200, Johan Hovold wrote: On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: From: Greg Kroah-Hartman gre...@linuxfoundation.org @@ -1040,11 +1044,10 @@ static int usb_serial_probe(struct usb_i */ serial-disconnected = 1; - if

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 11:40:25AM +0200, Johan Hovold wrote: On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: From: Greg Kroah-Hartman gre...@linuxfoundation.org [...] --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -37,6 +37,7 @@ #include

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: From: Greg Kroah-Hartman gre...@linuxfoundation.org [...] --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -37,6 +37,7 @@ #include linux/usb.h #include linux/usb/serial.h #include linux/kfifo.h

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Fri, Jun 07, 2013 at 11:40:25AM +0200, Johan Hovold wrote: On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: From: Greg Kroah-Hartman gre...@linuxfoundation.org [...] /* Functions needed by other parts of the usbserial core */ -extern struct usb_serial

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote: From: Greg Kroah-Hartman gre...@linuxfoundation.org @@ -1040,11 +1044,10 @@ static int usb_serial_probe(struct usb_i */ serial-disconnected = 1; - if (get_free_serial(serial, num_ports, minor) == NULL) { + if

[PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-06 Thread Greg KH
From: Greg Kroah-Hartman This moves the allocation of minor device numbers from a static array to be dynamic, using the idr interface. This means that you could potentially get "gaps" in a minor number range for a single USB serial device with multiple ports, but all should still work properly.

[PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-06 Thread Greg KH
From: Greg Kroah-Hartman gre...@linuxfoundation.org This moves the allocation of minor device numbers from a static array to be dynamic, using the idr interface. This means that you could potentially get gaps in a minor number range for a single USB serial device with multiple ports, but all