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

2013-06-18 Thread Johan Hovold
> > > @@ -123,8 +116,9 @@ static void return_serial(struct usb_ser > > > > > > mutex_lock(&table_lock); > > > for (i = 0; i < serial->num_ports; ++i) > > > - serial_table[serial->minor + i] = NULL; > > > + idr_remove(&serial_minors, serial->port[i]->minor); > > > mutex_unloc

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

2013-06-17 Thread Greg KH
On Sat, Jun 08, 2013 at 12:03:47PM +0200, Johan Hovold wrote: > On Fri, Jun 07, 2013 at 11:04:28AM -0700, Greg KH wrote: > > From: Greg Kroah-Hartman > > > Changes v2 - v3: > > - fixed up comments about usb_serial_get_by_minor() > > - fixed error case in usb_serial_get_by_minor() > > - fold

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

2013-06-08 Thread Johan Hovold
On Fri, Jun 07, 2013 at 11:04:28AM -0700, Greg KH wrote: > From: Greg Kroah-Hartman > Changes v2 - v3: > - fixed up comments about usb_serial_get_by_minor() > - fixed error case in usb_serial_get_by_minor() > - folded get_free_port() into get_free_serial() > - renamed get_free_serial() to

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

2013-06-07 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.