diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-09-01 11:38:34 -0400 |
---|---|---|
committer | Live-CD User <linux@linux.site> | 2009-09-19 13:13:39 -0700 |
commit | 41bd34ddd7aa46dbc03b5bb33896e0fa8100fe7b (patch) | |
tree | adfd9b5af7a68cfa053f1c3f8192578d612ca18e /lib/gcd.c | |
parent | a75b7b68ef73685784781d6d2bc416b6dac20969 (diff) |
usb-serial: change referencing of port and serial structures
This patch (as1284) changes the referencing of the usb_serial and
usb_serial_port structures in usb-serial.c. It's not feasible to make
the port structures keep a reference to the serial structure, because
the ports need to remain in existence when serial is released -- quite
a few of the drivers expect this. Consequently taking a reference
to the port when the device file is open is insufficient; such a
reference would not pin serial.
To fix this, we now take a reference to serial when the device file is
opened. The final put_device() for the ports occurs in
destroy_serial(), so that the ports will last as long as they are
needed.
The patch initializes all the port devices, including those in the
unused "fake" ports. This makes the code more uniform because they
can all be released in the same way. The error handling code in
usb_serial_probe() is much simplified by this approach; instead of
freeing everything by hand we can use a single usb_serial_put() call.
Also simplified is the port-release mechanism. Instead of being two
separate routines, port_release() and port_free() can be combined into
one.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/gcd.c')
0 files changed, 0 insertions, 0 deletions