diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2006-12-08 05:39:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:00 -0500 |
commit | ec3dde578a969ea4b0a8c3d45e02d73abab1b2d3 (patch) | |
tree | 738d8d5d20b960f0e58713887e285fc0c6462f53 /drivers/char/istallion.c | |
parent | f2362c9411e914642ffe216e10987bb9aae2a480 (diff) |
[PATCH] Char: istallion, dynamic tty device
register tty device dynamically according to the count of board ports.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/istallion.c')
-rw-r--r-- | drivers/char/istallion.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c index a1755186f7b4..f1752c81993b 100644 --- a/drivers/char/istallion.c +++ b/drivers/char/istallion.c | |||
@@ -3846,6 +3846,10 @@ static int stli_findeisabrds(void) | |||
3846 | 3846 | ||
3847 | stli_brds[brdp->brdnr] = brdp; | 3847 | stli_brds[brdp->brdnr] = brdp; |
3848 | found++; | 3848 | found++; |
3849 | |||
3850 | for (i = 0; i < brdp->nrports; i++) | ||
3851 | tty_register_device(stli_serial, | ||
3852 | brdp->brdnr * STL_MAXPORTS + i, NULL); | ||
3849 | } | 3853 | } |
3850 | 3854 | ||
3851 | return found; | 3855 | return found; |
@@ -3872,6 +3876,7 @@ static int __devinit stli_pciprobe(struct pci_dev *pdev, | |||
3872 | const struct pci_device_id *ent) | 3876 | const struct pci_device_id *ent) |
3873 | { | 3877 | { |
3874 | struct stlibrd *brdp; | 3878 | struct stlibrd *brdp; |
3879 | unsigned int i; | ||
3875 | int brdnr, retval = -EIO; | 3880 | int brdnr, retval = -EIO; |
3876 | 3881 | ||
3877 | retval = pci_enable_device(pdev); | 3882 | retval = pci_enable_device(pdev); |
@@ -3912,6 +3917,10 @@ static int __devinit stli_pciprobe(struct pci_dev *pdev, | |||
3912 | brdp->enable = NULL; | 3917 | brdp->enable = NULL; |
3913 | brdp->disable = NULL; | 3918 | brdp->disable = NULL; |
3914 | 3919 | ||
3920 | for (i = 0; i < brdp->nrports; i++) | ||
3921 | tty_register_device(stli_serial, brdp->brdnr * STL_MAXPORTS + i, | ||
3922 | &pdev->dev); | ||
3923 | |||
3915 | return 0; | 3924 | return 0; |
3916 | err_null: | 3925 | err_null: |
3917 | stli_brds[brdp->brdnr] = NULL; | 3926 | stli_brds[brdp->brdnr] = NULL; |
@@ -3992,6 +4001,10 @@ static int stli_initbrds(void) | |||
3992 | } | 4001 | } |
3993 | stli_brds[brdp->brdnr] = brdp; | 4002 | stli_brds[brdp->brdnr] = brdp; |
3994 | found++; | 4003 | found++; |
4004 | |||
4005 | for (i = 0; i < brdp->nrports; i++) | ||
4006 | tty_register_device(stli_serial, | ||
4007 | brdp->brdnr * STL_MAXPORTS + i, NULL); | ||
3995 | } | 4008 | } |
3996 | 4009 | ||
3997 | retval = stli_findeisabrds(); | 4010 | retval = stli_findeisabrds(); |
@@ -4596,7 +4609,7 @@ static int __init istallion_module_init(void) | |||
4596 | stli_serial->type = TTY_DRIVER_TYPE_SERIAL; | 4609 | stli_serial->type = TTY_DRIVER_TYPE_SERIAL; |
4597 | stli_serial->subtype = SERIAL_TYPE_NORMAL; | 4610 | stli_serial->subtype = SERIAL_TYPE_NORMAL; |
4598 | stli_serial->init_termios = stli_deftermios; | 4611 | stli_serial->init_termios = stli_deftermios; |
4599 | stli_serial->flags = TTY_DRIVER_REAL_RAW; | 4612 | stli_serial->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; |
4600 | tty_set_operations(stli_serial, &stli_ops); | 4613 | tty_set_operations(stli_serial, &stli_ops); |
4601 | 4614 | ||
4602 | retval = tty_register_driver(stli_serial); | 4615 | retval = tty_register_driver(stli_serial); |