linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Mraz <t8m@centrum.cz>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] Moxa Smartio driver
Date: Wed, 21 Feb 2001 09:35:51 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.30.0102210935200.18348-100000@p38mraz.cbu.pvt.cz> (raw)

Hi all,

I send you a patch to the Moxa Smartio driver in the 2.4.1 kernel.
There are included the fixes which I've made to make my Moxa Smartio Card
work.

First there is backed out the wrong fix which was included in some of the
2.4.0-testxx version. Then there is a fix to the PCI lookup of the card.
And finally there is a fix to module usage count which wasn't properly
increased.

--- ../linux/drivers/char/mxser.c	Wed Dec  6 21:06:18 2000
+++ linux/drivers/char/mxser.c	Tue Feb 20 18:19:08 2001
@@ -120,7 +120,7 @@
 #define CI104J_ASIC_ID  5

 enum {
-	MXSER_BOARD_C168_ISA = 0,
+	MXSER_BOARD_C168_ISA = 1,
 	MXSER_BOARD_C104_ISA,
 	MXSER_BOARD_CI104J,
 	MXSER_BOARD_C168_PCI,
@@ -617,16 +617,18 @@
 			pdev = pci_find_device(mxser_pcibrds[b].vendor_id,
 					       mxser_pcibrds[b].device_id, pdev);
 			if (!pdev)
-				break;
+			{
+				b++;
+				continue;
+			}
 			if (pci_enable_device(pdev))
 				continue;
-			b++;
 			hwconf.pdev = pdev;
 			printk("Found MOXA %s board(BusNo=%d,DevNo=%d)\n",
 				mxser_brdname[mxser_pcibrds[b].board_type - 1],
 				pdev->bus->number, PCI_SLOT(pdev->devfn >> 3));
 			if (m >= MXSER_BOARDS) {
-				printk("Too many Smartio family boards find (maximum %d),board not configured\n", MXSER_BOARDS);
+				printk("Too many Smartio family boards found (maximum %d),board not configured\n", MXSER_BOARDS);
 			} else {
 				retval = mxser_get_PCI_conf(pdev,
 				   mxser_pcibrds[b].board_type, &hwconf);
@@ -1457,7 +1459,9 @@

 	if (info->xmit_cnt < WAKEUP_CHARS) {
 		set_bit(MXSER_EVENT_TXLOW, &info->event);
-		schedule_task(&info->tqueue);
+		MOD_INC_USE_COUNT;
+		if (schedule_task(&info->tqueue) == 0)
+		    MOD_DEC_USE_COUNT;
 	}
 	if (info->xmit_cnt <= 0) {
 		info->IER &= ~UART_IER_THRI;
@@ -1486,8 +1490,9 @@
 		else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
 			   (info->flags & ASYNC_CALLOUT_NOHUP)))
 			set_bit(MXSER_EVENT_HANGUP, &info->event);
-		schedule_task(&info->tqueue);
-
+		MOD_INC_USE_COUNT;
+		if (schedule_task(&info->tqueue) == 0)
+		    MOD_DEC_USE_COUNT;
 	}
 	if (info->flags & ASYNC_CTS_FLOW) {
 		if (info->tty->hw_stopped) {



I would like to send the patch to Linus, but because it's my first patch to
kernel, I would like someone to comment it. Please cc me on your reply,
because I read the kernel mailing list only on some web archive.

Thanks,
Tomas Mraz

-----------------------------------------------------------------
No matter how far down the wrong road you've gone, turn back.
						Turkish proverb



                 reply	other threads:[~2001-02-21  8:36 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=Pine.LNX.4.30.0102210935200.18348-100000@p38mraz.cbu.pvt.cz \
    --to=t8m@centrum.cz \
    --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;
as well as URLs for NNTP newsgroup(s).