public inbox for linux-kernel@vger.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 5/7] Char: isicom, move to tty_register_device
Date: Thu, 19 Oct 2006 22:26:59 +0200 (CEST)	[thread overview]
Message-ID: <1124097211503417126@wsc.cz> (raw)

isicom, move to tty_register_device

Instead of registering all devices in register_tty_driver, register devices in
probe function and register only port_count devices.

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

---
commit 780d1e45bab78cb6cc6c79037bfe0986bc999332
tree db4ce54aba8eff0bfbed4afe41bbffbbe33204a8
parent a2d2f722e0d805a57d7835e715c520ca7a7580a7
author Jiri Slaby <jirislaby@gmail.com> Thu, 19 Oct 2006 19:39:23 +0200
committer Jiri Slaby <jirislaby@gmail.com> Thu, 19 Oct 2006 19:39:23 +0200

 drivers/char/isicom.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c
index 1b9ef44..f07226a 100644
--- a/drivers/char/isicom.c
+++ b/drivers/char/isicom.c
@@ -195,6 +195,7 @@ struct	isi_board {
 	signed char		count;
 	spinlock_t		card_lock; /* Card wide lock 11/5/00 -sameer */
 	unsigned long		flags;
+	unsigned int		index;
 };
 
 struct	isi_port {
@@ -1780,6 +1781,7 @@ static int __devinit isicom_probe(struct
 			break;
 		}
 
+	board->index = index;
 	board->base = ioaddr;
 	board->irq = pciirq;
 	card++;
@@ -1810,6 +1812,10 @@ static int __devinit isicom_probe(struct
 	if (retval < 0)
 		goto errunri;
 
+	for (index = 0; index < board->port_count; index++)
+		tty_register_device(isicom_normal, board->index * 16 + index,
+				&pdev->dev);
+
 	return 0;
 
 errunri:
@@ -1824,6 +1830,10 @@ err:
 static void __devexit isicom_remove(struct pci_dev *pdev)
 {
 	struct isi_board *board = pci_get_drvdata(pdev);
+	unsigned int i;
+
+	for (i = 0; i < board->port_count; i++)
+		tty_unregister_device(isicom_normal, board->index * 16 + i);
 
 	free_irq(board->irq, board);
 	release_region(board->base, 16);
@@ -1873,7 +1883,8 @@ static int __init isicom_init(void)
 	isicom_normal->init_termios		= tty_std_termios;
 	isicom_normal->init_termios.c_cflag	= B9600 | CS8 | CREAD | HUPCL |
 		CLOCAL;
-	isicom_normal->flags			= TTY_DRIVER_REAL_RAW;
+	isicom_normal->flags			= TTY_DRIVER_REAL_RAW |
+		TTY_DRIVER_DYNAMIC_DEV;
 	tty_set_operations(isicom_normal, &isicom_ops);
 
 	retval = tty_register_driver(isicom_normal);

                 reply	other threads:[~2006-10-19 20:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1124097211503417126@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox