Commit e95ac143 authored by Jan Kiszka's avatar Jan Kiszka Committed by David S. Miller

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: default avatarJan Kiszka <jan.kiszka@web.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40fb2d0d
...@@ -60,10 +60,8 @@ module_param_named(major, capi_major, uint, 0); ...@@ -60,10 +60,8 @@ module_param_named(major, capi_major, uint, 0);
#define CAPINC_NR_PORTS 32 #define CAPINC_NR_PORTS 32
#define CAPINC_MAX_PORTS 256 #define CAPINC_MAX_PORTS 256
static int capi_ttymajor = 191;
static int capi_ttyminors = CAPINC_NR_PORTS; static int capi_ttyminors = CAPINC_NR_PORTS;
module_param_named(ttymajor, capi_ttymajor, uint, 0);
module_param_named(ttyminors, capi_ttyminors, uint, 0); module_param_named(ttyminors, capi_ttyminors, uint, 0);
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
...@@ -301,6 +299,7 @@ static struct capiminor *capiminor_get(unsigned int minor) ...@@ -301,6 +299,7 @@ static struct capiminor *capiminor_get(unsigned int minor)
static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np)
{ {
struct capiminor *mp; struct capiminor *mp;
dev_t device;
if (!(cdev->userflags & CAPIFLAG_HIGHJACKING)) if (!(cdev->userflags & CAPIFLAG_HIGHJACKING))
return; return;
...@@ -311,9 +310,8 @@ static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np) ...@@ -311,9 +310,8 @@ static void capincci_alloc_minor(struct capidev *cdev, struct capincci *np)
#ifdef _DEBUG_REFCOUNT #ifdef _DEBUG_REFCOUNT
printk(KERN_DEBUG "set mp->nccip\n"); printk(KERN_DEBUG "set mp->nccip\n");
#endif #endif
mp->capifs_dentry = device = MKDEV(capinc_tty_driver->major, mp->minor);
capifs_new_ncci(mp->minor, mp->capifs_dentry = capifs_new_ncci(mp->minor, device);
MKDEV(capi_ttymajor, mp->minor));
} }
} }
...@@ -1341,7 +1339,7 @@ static int __init capinc_tty_init(void) ...@@ -1341,7 +1339,7 @@ static int __init capinc_tty_init(void)
drv->owner = THIS_MODULE; drv->owner = THIS_MODULE;
drv->driver_name = "capi_nc"; drv->driver_name = "capi_nc";
drv->name = "capi"; drv->name = "capi";
drv->major = capi_ttymajor; drv->major = 0;
drv->minor_start = 0; drv->minor_start = 0;
drv->type = TTY_DRIVER_TYPE_SERIAL; drv->type = TTY_DRIVER_TYPE_SERIAL;
drv->subtype = SERIAL_TYPE_NORMAL; drv->subtype = SERIAL_TYPE_NORMAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment