diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-07 18:04:28 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 20:30:02 (GMT) |
commit | e5b1e2062e0535e8ffef79bb34d857e21380d101 (patch) | |
tree | 75376f4cb69f6a1cd05b323803ae6a1a8fc4db90 /drivers/usb/serial/ark3116.c | |
parent | 1508124d8a4e0995362d93d82e5555a74bfc998f (diff) | |
download | linux-e5b1e2062e0535e8ffef79bb34d857e21380d101.tar.xz |
USB: serial: make minor allocation dynamic
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.
We remove the 'minor' field from the usb_serial structure, as it no
longer makes any sense for it (use the field in the usb_serial_port
structure if you really want to know this number), and take the fact
that we were overloading a number in this field to determine if we had
initialized the minor numbers or not, and just use a flag variable
instead.
Note, we still have the limitation of 255 USB to serial devices in the
system, as that is all we are registering with the TTY layer at this
point in time.
Tested-by: Tobias Winter <tobias@linuxdingsda.de>
Reviewed-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ark3116.c')
-rw-r--r-- | drivers/usb/serial/ark3116.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 293a770..bc77e95 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -413,7 +413,7 @@ static int ark3116_ioctl(struct tty_struct *tty, /* XXX: Some of these values are probably wrong. */ memset(&serstruct, 0, sizeof(serstruct)); serstruct.type = PORT_16654; - serstruct.line = port->serial->minor; + serstruct.line = port->minor; serstruct.port = port->port_number; serstruct.custom_divisor = 0; serstruct.baud_base = 460800; |