All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@googlemail.com>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-kernel@vger.kernel.org,
	Bernie Thompson <bernie@plugable.com>,
	David Herrmann <dh.herrmann@googlemail.com>
Subject: [PATCH v2 2/3] input: increase INPUT_DEVICES to 512 to allow dynamic minors
Date: Thu, 20 Sep 2012 19:52:02 +0200	[thread overview]
Message-ID: <1348163523-2062-3-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1348163523-2062-1-git-send-email-dh.herrmann@googlemail.com>

All minor numbers for input devices are currently reserved for static
allocations. So increase the maximum number of input-devices to 512 to
give room of 256 devices for dynamic-minor allocation.

register_chrdev uses 256 as default limit so we need to change this
function call to actually pass the new number of devices. This makes it
also clearer how many minor numbers are actually allocated.

Please note that this doesn't increase the memory footprint at all. The
major/minor allocations are no longer realized by lookup-tables so we
could even increase this to some insanely large value and wouldn't loose
any performance here.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 drivers/input/input.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 2741ce1..f8d985f 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -32,7 +32,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
 MODULE_DESCRIPTION("Input core");
 MODULE_LICENSE("GPL");
 
-#define INPUT_DEVICES	256
+#define INPUT_DEVICES 512
 
 static LIST_HEAD(input_dev_list);
 static LIST_HEAD(input_handler_list);
@@ -2310,7 +2310,8 @@ static int __init input_init(void)
 	if (err)
 		goto fail1;
 
-	err = register_chrdev(INPUT_MAJOR, "input", &input_fops);
+	err = __register_chrdev(INPUT_MAJOR, 0, INPUT_DEVICES, "input",
+				&input_fops);
 	if (err) {
 		pr_err("unable to register char major %d", INPUT_MAJOR);
 		goto fail2;
-- 
1.7.12


  parent reply	other threads:[~2012-09-20 17:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 17:52 [PATCH v2 0/3] input: Dynamic Minor Numbers David Herrmann
2012-09-20 17:52 ` [PATCH v2 1/3] input: add dynamic-minor allocation helpers David Herrmann
2012-09-20 17:52 ` David Herrmann [this message]
2012-09-20 17:52 ` [PATCH v2 3/3] input: evdev: use dynamic-minors if running out of static minors David Herrmann
2012-09-21  8:07 ` [PATCH v2 0/3] input: Dynamic Minor Numbers Dmitry Torokhov
2012-09-21  9:22   ` David Herrmann
2012-09-21 19:18     ` David Herrmann
2012-09-21 20:51       ` Dmitry Torokhov
2012-09-21 21:32         ` David Herrmann
2012-09-25  8:55   ` David Herrmann

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=1348163523-2062-3-git-send-email-dh.herrmann@googlemail.com \
    --to=dh.herrmann@googlemail.com \
    --cc=bernie@plugable.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.