Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755538Ab0BHUSK (ORCPT ); Mon, 8 Feb 2010 15:18:10 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:43270 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754906Ab0BHUNJ (ORCPT ); Mon, 8 Feb 2010 15:13:09 -0500 From: Jan Kiszka To: David Miller , Karsten Keil Cc: linux-kernel@vger.kernel.org, i4ldeveloper@listserv.isdn4linux.de, isdn4linux@listserv.isdn4linux.de, netdev@vger.kernel.org, Alan Cox , Marcel Holtmann Subject: [PATCH v2 22/41] CAPI: Use dynamic major for NCCI TTYs by default Date: Mon, 8 Feb 2010 21:12:26 +0100 Message-Id: X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V01U2FsdGVkX1/FoJNgNGTh1/cmyhu/TymtDFLpexc/0gAKnpOj p5tagkLoXaZeTC6yvkZjeMq3vKerc/5CBlAxav75h+bQKO25Hz 8L+Bfe2A0= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1969 Lines: 60 No need to allocate a fixed major for this TTY, both capifs and udev make this transparent to the user. Signed-off-by: Jan Kiszka --- drivers/isdn/capi/capi.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 901b79b..b1de0cb 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -60,10 +60,8 @@ module_param_named(major, capi_major, uint, 0); #define CAPINC_NR_PORTS 32 #define CAPINC_MAX_PORTS 256 -static int capi_ttymajor = 191; static int capi_ttyminors = CAPINC_NR_PORTS; -module_param_named(ttymajor, capi_ttymajor, uint, 0); module_param_named(ttyminors, capi_ttyminors, uint, 0); #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ @@ -301,6 +299,7 @@ static struct capiminor *capiminor_get(unsigned int minor) static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) { struct capiminor *mp; + dev_t device; if (!(cdev->userflags & CAPIFLAG_HIGHJACKING)) return; @@ -311,9 +310,8 @@ static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) #ifdef _DEBUG_REFCOUNT printk(KERN_DEBUG "set mp->nccip\n"); #endif - mp->capifs_dentry = - capifs_new_ncci(mp->minor, - MKDEV(capi_ttymajor, mp->minor)); + device = MKDEV(capinc_tty_driver->major, mp->minor); + mp->capifs_dentry = capifs_new_ncci(mp->minor, device); } } @@ -1341,7 +1339,7 @@ static int __init capinc_tty_init(void) drv->owner = THIS_MODULE; drv->driver_name = "capi_nc"; drv->name = "capi"; - drv->major = capi_ttymajor; + drv->major = 0; drv->minor_start = 0; drv->type = TTY_DRIVER_TYPE_SERIAL; drv->subtype = SERIAL_TYPE_NORMAL; -- 1.6.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/