diff options
author | Jan Kiszka <jan.kiszka@web.de> | 2010-02-08 05:12:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 19:01:27 -0500 |
commit | e95ac143868752ad30d93068a6fc0b39cf3a1bf4 (patch) | |
tree | 0f0cfb360833f9daf955a6610b7d5d26d548246c /drivers | |
parent | 40fb2d0da77df5d39f1ba8878502725ebb806554 (diff) |
CAPI: Use dynamic major for NCCI TTYs by default
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 <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 901b79bc3b56..b1de0cbea69e 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); | |||
60 | #define CAPINC_NR_PORTS 32 | 60 | #define CAPINC_NR_PORTS 32 |
61 | #define CAPINC_MAX_PORTS 256 | 61 | #define CAPINC_MAX_PORTS 256 |
62 | 62 | ||
63 | static int capi_ttymajor = 191; | ||
64 | static int capi_ttyminors = CAPINC_NR_PORTS; | 63 | static int capi_ttyminors = CAPINC_NR_PORTS; |
65 | 64 | ||
66 | module_param_named(ttymajor, capi_ttymajor, uint, 0); | ||
67 | module_param_named(ttyminors, capi_ttyminors, uint, 0); | 65 | module_param_named(ttyminors, capi_ttyminors, uint, 0); |
68 | #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ | 66 | #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ |
69 | 67 | ||
@@ -301,6 +299,7 @@ static struct capiminor *capiminor_get(unsigned int minor) | |||
301 | static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) | 299 | static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) |
302 | { | 300 | { |
303 | struct capiminor *mp; | 301 | struct capiminor *mp; |
302 | dev_t device; | ||
304 | 303 | ||
305 | if (!(cdev->userflags & CAPIFLAG_HIGHJACKING)) | 304 | if (!(cdev->userflags & CAPIFLAG_HIGHJACKING)) |
306 | return; | 305 | return; |
@@ -311,9 +310,8 @@ static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) | |||
311 | #ifdef _DEBUG_REFCOUNT | 310 | #ifdef _DEBUG_REFCOUNT |
312 | printk(KERN_DEBUG "set mp->nccip\n"); | 311 | printk(KERN_DEBUG "set mp->nccip\n"); |
313 | #endif | 312 | #endif |
314 | mp->capifs_dentry = | 313 | device = MKDEV(capinc_tty_driver->major, mp->minor); |
315 | capifs_new_ncci(mp->minor, | 314 | mp->capifs_dentry = capifs_new_ncci(mp->minor, device); |
316 | MKDEV(capi_ttymajor, mp->minor)); | ||
317 | } | 315 | } |
318 | } | 316 | } |
319 | 317 | ||
@@ -1341,7 +1339,7 @@ static int __init capinc_tty_init(void) | |||
1341 | drv->owner = THIS_MODULE; | 1339 | drv->owner = THIS_MODULE; |
1342 | drv->driver_name = "capi_nc"; | 1340 | drv->driver_name = "capi_nc"; |
1343 | drv->name = "capi"; | 1341 | drv->name = "capi"; |
1344 | drv->major = capi_ttymajor; | 1342 | drv->major = 0; |
1345 | drv->minor_start = 0; | 1343 | drv->minor_start = 0; |
1346 | drv->type = TTY_DRIVER_TYPE_SERIAL; | 1344 | drv->type = TTY_DRIVER_TYPE_SERIAL; |
1347 | drv->subtype = SERIAL_TYPE_NORMAL; | 1345 | drv->subtype = SERIAL_TYPE_NORMAL; |