All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/5] Char: istallion, dynamic tty device
Date: Sat, 11 Nov 2006 22:49:02 +0100 (CET)	[thread overview]
Message-ID: <129784351190324394@wsc.cz> (raw)
In-Reply-To: <196416110522272@wsc.cz>

istallion, dynamic tty device

register tty device dynamically according to the count of board ports.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>

---
commit 010cb3032661418012dd0949ff3566927ed430cd
tree 3da0c21735d8a6e32c59dde2ec2979c9dc9680c7
parent 92452a22c4ada362e991cbf0de84c8914525672a
author Jiri Slaby <jirislaby@gmail.com> Sat, 11 Nov 2006 02:29:24 +0100
committer Jiri Slaby <jirislaby@gmail.com> Sat, 11 Nov 2006 22:23:36 +0100

 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 bf58938..cbbc3cd 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -3846,6 +3846,10 @@ static int stli_findeisabrds(void)
 
 		stli_brds[brdp->brdnr] = brdp;
 		found++;
+
+		for (i = 0; i < brdp->nrports; i++)
+			tty_register_device(stli_serial,
+					brdp->brdnr * STL_MAXPORTS + i, NULL);
 	}
 
 	return found;
@@ -3872,6 +3876,7 @@ static int __devinit stli_pciprobe(struc
 		const struct pci_device_id *ent)
 {
 	struct stlibrd *brdp;
+	unsigned int i;
 	int brdnr, retval = -EIO;
 
 	retval = pci_enable_device(pdev);
@@ -3912,6 +3917,10 @@ static int __devinit stli_pciprobe(struc
 	brdp->enable = NULL;
 	brdp->disable = NULL;
 
+	for (i = 0; i < brdp->nrports; i++)
+		tty_register_device(stli_serial, brdp->brdnr * STL_MAXPORTS + i,
+				&pdev->dev);
+
 	return 0;
 err_null:
 	stli_brds[brdp->brdnr] = NULL;
@@ -3992,6 +4001,10 @@ static int stli_initbrds(void)
 		}
 		stli_brds[brdp->brdnr] = brdp;
 		found++;
+
+		for (i = 0; i < brdp->nrports; i++)
+			tty_register_device(stli_serial,
+					brdp->brdnr * STL_MAXPORTS + i, NULL);
 	}
 
 	retval = stli_findeisabrds();
@@ -4596,7 +4609,7 @@ static int __init istallion_module_init(
 	stli_serial->type = TTY_DRIVER_TYPE_SERIAL;
 	stli_serial->subtype = SERIAL_TYPE_NORMAL;
 	stli_serial->init_termios = stli_deftermios;
-	stli_serial->flags = TTY_DRIVER_REAL_RAW;
+	stli_serial->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
 	tty_set_operations(stli_serial, &stli_ops);
 
 	retval = tty_register_driver(stli_serial);

  parent reply	other threads:[~2006-11-11 21:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-11 21:48 [PATCH 1/5] Char: istallion, fix enabling Jiri Slaby
2006-11-11 21:48 ` [PATCH 2/5] Char: istallion, move init and exit code Jiri Slaby
2006-11-11 21:48 ` [PATCH 3/5] Char: istallion, change init sequence Jiri Slaby
2006-11-11 21:49 ` Jiri Slaby [this message]
2006-11-11 21:49 ` [PATCH 5/5] Char: istallion, use mod_timer Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=129784351190324394@wsc.cz \
    --to=jirislaby@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.