From patchwork Thu Sep 20 17:52:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 1486801 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0E9EBDF2D2 for ; Thu, 20 Sep 2012 17:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751611Ab2ITRuu (ORCPT ); Thu, 20 Sep 2012 13:50:50 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:55265 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220Ab2ITRuY (ORCPT ); Thu, 20 Sep 2012 13:50:24 -0400 Received: by wibcb5 with SMTP id cb5so630123wib.1 for ; Thu, 20 Sep 2012 10:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ANmREwcq8K20whg1gNS6bT9se+56kYkcHV3uW0K8CQY=; b=e4LEhI+o0Xjhh+hmwlZiGY4MUfH9BzSHrpM5F2jpC2tlTNLg8F7SzgNcuHqYZC2NJ+ +v4emCO4Yy6pUr0CAm1GODCvD3UQITb7skVDsQg9wWALyby6gNJaIJ/DpcZULFOSaHbr l9pRficmsvmfgxu7N6zAX/ynv4kwKLVkcKycpNg7s1HBOnbWdESiZGSU47bOyxIiqoWo r+3/EtEt8ooNA4WPKYUcocAEf+/1xvBI/05cyiBF+Fg2+jmvtpM5rff9UEWP+fjeXRUY lEbyMFG6MZFnXSTT69Q+rMaavagdFQeLHqPenaK43aNe8YmBA2dTjmk7koxleZRBOIDN /9hQ== Received: by 10.216.206.209 with SMTP id l59mr1452875weo.217.1348163422886; Thu, 20 Sep 2012 10:50:22 -0700 (PDT) Received: from localhost.localdomain (stgt-5f71b0e1.pool.mediaWays.net. [95.113.176.225]) by mx.google.com with ESMTPS id q4sm33622752wix.9.2012.09.20.10.50.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 10:50:22 -0700 (PDT) From: David Herrmann To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , linux-kernel@vger.kernel.org, Bernie Thompson , David Herrmann Subject: [PATCH v2 2/3] input: increase INPUT_DEVICES to 512 to allow dynamic minors Date: Thu, 20 Sep 2012 19:52:02 +0200 Message-Id: <1348163523-2062-3-git-send-email-dh.herrmann@googlemail.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1348163523-2062-1-git-send-email-dh.herrmann@googlemail.com> References: <1348163523-2062-1-git-send-email-dh.herrmann@googlemail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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 "); 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;