lkml.org 
[lkml]   [2013]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] USB: serial: make minor allocation dynamic
> > > @@ -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_unlock(&table_lock);
> > > + serial->minors_reserved = 0;
> >
> > This isn't strictly needed as the serial struct release_serial is only
> > called once when the struct is about to be freed.
>
> Really? Why were we doing this type of thing before with the "not
> allocated" flag? It seems that we were protecting some path that I
> can't remember at the moment. So to be safe, I'll leave it for now...

It was and is only used when releasing the serial struct to check
whether minors had been allocated or not at probe and if return_serial
(release_minors) should be called. This in done in destroy_serial just
before freeing the struct, so clearing the flag is redundant, but
doesn't hurt anyone, I guess. ;)

Johan


\
 
 \ /
  Last update: 2013-06-18 13:42    [W:0.150 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site