public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Tobias Winter" <tobias@linuxdingsda.de>,
	"Bjørn Mork" <bjorn@mork.no>, "Rob Landley" <rob@landley.net>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] USB: serial: increase the number of devices we support
Date: Wed, 5 Jun 2013 10:55:12 -0700	[thread overview]
Message-ID: <20130605175512.GC13461@kroah.com> (raw)
In-Reply-To: <20130605175426.GA13461@kroah.com>

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

We had the limit of 255 USB to serial devices on one system for almost
15 years, with no complaints.  But now it's time to move on from these
tiny "baby" systems, and bump the number up to 3000, which should last
us a few more years.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/serial/usb-serial.c |    8 ++++++--
 include/linux/usb/serial.h      |    4 ----
 2 files changed, 6 insertions(+), 6 deletions(-)

--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -43,6 +43,10 @@
 #define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
 #define DRIVER_DESC "USB Serial Driver core"
 
+#define SERIAL_TTY_MAJOR	188
+#define SERIAL_TTY_MINORS	3000	/* should be enough for a while */
+#define SERIAL_TTY_NO_MINOR	(SERIAL_TTY_MINORS + 1)
+
 /* There is no MODULE_DEVICE_TABLE for usbserial.c.  Instead
    the MODULE_DEVICE_TABLE declarations in each serial driver
    cause the "hotplug" program to pull in whatever module is necessary
@@ -105,12 +109,12 @@ static int get_free_serial(struct usb_se
 
 	dev_dbg(&serial->interface->dev, "%s %d\n", __func__, num_ports);
 
-	*minor = 0xffffffff;
+	*minor = SERIAL_TTY_NO_MINOR;
 	for (i = 0; i < num_ports; ++i) {
 		x = get_free_port(serial->port[i]);
 		if (x < 0)
 			goto error;
-		if (*minor == 0xffffffff)
+		if (*minor == SERIAL_TTY_NO_MINOR)
 			*minor = x;
 		serial->port[i]->port_number = i;
 	}
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -19,10 +19,6 @@
 #include <linux/sysrq.h>
 #include <linux/kfifo.h>
 
-#define SERIAL_TTY_MAJOR	188	/* Nice legal number now */
-#define SERIAL_TTY_MINORS	254	/* loads of devices :) */
-#define SERIAL_TTY_NO_MINOR	0xffffffff	/* No minor was assigned */
-
 /* The maximum number of ports one device can grab at once */
 #define MAX_NUM_PORTS		8
 

  parent reply	other threads:[~2013-06-05 17:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 17:54 [PATCH 0/3] Increase the number of USB to serial devices we can support at once Greg KH
2013-06-05 17:54 ` [PATCH 2/3] USB: serial: make minor allocation dynamic Greg KH
2013-06-06 12:17   ` Johan Hovold
2013-06-06 16:33     ` Greg KH
2013-06-05 17:55 ` Greg KH [this message]
2013-06-05 17:55 ` [PATCH 1/3] USB: serial: ports: add minor and port number Greg KH
2013-06-06 11:31   ` Johan Hovold
2013-06-06 11:32     ` [PATCH] USB: whiteheat: fix broken port configuration Johan Hovold
2013-06-06 16:37     ` [PATCH 1/3] USB: serial: ports: add minor and port number Greg KH
2013-06-06 11:35 ` [PATCH 0/3] Increase the number of USB to serial devices we can support at once Tobias Winter
2013-06-06 15:01 ` Dave Jones
2013-06-06 15:21   ` Greg KH
2013-06-06 16:24     ` Tobias Winter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130605175512.GC13461@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bjorn@mork.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=tobias@linuxdingsda.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox