All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/21] Char: cyclades, use IS_CYC_Z macro
Date: Sun, 29 Apr 2007 22:53:19 +0200 (CEST)	[thread overview]
Message-ID: <1726067771982725064@wsc.cz> (raw)

cyclades, use IS_CYC_Z macro

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

---
commit 167ae9073fef562913c9d68d32da883da5444fbc
tree 5d5795a789e6ce98a5a1226cf88e2b98b1d9a12a
parent b462f2fd89bff92e55be6a5317a3be0ad6a93ad8
author Jiri Slaby <jirislaby@gmail.com> Tue, 24 Apr 2007 21:40:00 +0200
committer Jiri Slaby <jirislaby@gmail.com> Fri, 27 Apr 2007 13:14:54 +0200

 drivers/char/cyclades.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 9d22d58..d3b42e8 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -3616,11 +3616,6 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
 			((status & CyCTS) ? TIOCM_CTS : 0);
 	} else {
 		base_addr = cy_card[card].base_addr;
-
-		if (cy_card[card].num_chips != -1) {
-			return -EINVAL;
-		}
-
 		firm_id = cy_card[card].base_addr + ID_ADDRESS;
 		if (ISZLOADED(cy_card[card])) {
 			zfw_ctrl = cy_card[card].base_addr +
@@ -4513,7 +4508,7 @@ static void __devinit cy_init_card(struct cyclades_card *cinfo,
 	unsigned short chip_number;
 	int index, port;
 
-	if (cinfo->num_chips == -1) {	/* Cyclades-Z */
+	if (IS_CYC_Z(*cinfo)) {	/* Cyclades-Z */
 		mailbox = readl(&((struct RUNTIME_9060 __iomem *)
 				     cinfo->ctl_addr)->mail_box_0);
 		nports = (mailbox == ZE_V1) ? ZE_V1_NPORTS : 8;
@@ -5346,12 +5341,12 @@ static void __devexit cy_pci_release(struct pci_dev *pdev)
 	unsigned int i;
 
 	/* non-Z with old PLX */
-	if (cinfo->num_chips != -1 && (readb(cinfo->base_addr + CyPLX_VER) &
-				0x0f) == PLX_9050)
+	if (!IS_CYC_Z(*cinfo) && (readb(cinfo->base_addr + CyPLX_VER) & 0x0f) ==
+			PLX_9050)
 		cy_writeb(cinfo->ctl_addr + 0x4c, 0);
 	else
 #ifndef CONFIG_CYZ_INTR
-		if (cinfo->num_chips != -1)
+		if (!IS_CYC_Z(*cinfo))
 #endif
 		cy_writew(cinfo->ctl_addr + 0x68,
 				readw(cinfo->ctl_addr + 0x68) & ~0x0900);
@@ -5361,7 +5356,7 @@ static void __devexit cy_pci_release(struct pci_dev *pdev)
 		pci_iounmap(pdev, cinfo->ctl_addr);
 	if (cinfo->irq
 #ifndef CONFIG_CYZ_INTR
-		&& cinfo->num_chips != -1 /* not a Z card */
+		&& !IS_CYC_Z(*cinfo)
 #endif /* CONFIG_CYZ_INTR */
 		)
 		free_irq(cinfo->irq, cinfo);
@@ -5582,7 +5577,7 @@ static void __exit cy_cleanup_module(void)
 				iounmap(cy_card[i].ctl_addr);
 			if (cy_card[i].irq
 #ifndef CONFIG_CYZ_INTR
-				&& cy_card[i].num_chips != -1 /* not a Z card */
+				&& !IS_CYC_Z(cy_card[i])
 #endif /* CONFIG_CYZ_INTR */
 				)
 				free_irq(cy_card[i].irq, &cy_card[i]);

             reply	other threads:[~2007-04-29 20:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-29 20:53 Jiri Slaby [this message]
2007-04-29 20:54 ` [PATCH 2/21] Char: cyclades, switch to pci probing Jiri Slaby
2007-04-29 20:54 ` [PATCH 3/21] Char: cyclades, depends on PCI or ISA Jiri Slaby
2007-04-29 20:55 ` [PATCH 4/21] Char: cyclades, unexport struct cyclades_card Jiri Slaby
2007-04-29 20:56 ` [PATCH 5/21] Char: cyclades, remove useless fileds from cyclades_card Jiri Slaby
2007-04-29 20:57 ` [PATCH 6/21] Char: cyclades, irq is int Jiri Slaby
2007-04-29 20:57 ` [PATCH 7/21] Char: cyclades, printk cleanups Jiri Slaby
2007-04-29 20:58 ` [PATCH 8/21] Char: cyclades, mark cyy_init_card as __devinit, not __init Jiri Slaby
2007-04-29 20:59 ` [PATCH 9/21] Char: cyclades, simplify variables initialization Jiri Slaby
2007-04-29 20:59 ` [PATCH 10/21] Char: cyclades, get rid of phys addresses Jiri Slaby
2007-04-29 21:00 ` [PATCH 11/21] Char: cyclades, make info->card a pointer Jiri Slaby
2007-04-29 21:01 ` [PATCH 12/21] Char: cyclades, remove sleep_on Jiri Slaby
2007-04-29 21:01 ` [PATCH 13/21] Char: cyclades, fix blockmove Jiri Slaby
2007-04-29 21:02 ` [PATCH 14/21] Char: cyclades, timers cleanup Jiri Slaby
2007-04-29 21:03 ` [PATCH 15/21] Char: cyclades, remove unused timestamps Jiri Slaby
2007-04-29 21:03 ` [PATCH 16/21] Char: cyclades, remove locking macros Jiri Slaby
2007-04-29 21:04 ` [PATCH 17/21] Char: cyclades, conditions cleanup Jiri Slaby
2007-04-29 21:05 ` [PATCH 18/21] Char: cyclades, fix tty device unregister Jiri Slaby
2007-04-29 21:06 ` [PATCH 19/21] Char: cyclades, dynamic ports Jiri Slaby
2007-04-29 21:06 ` [PATCH 20/21] Char: cyclades, probe cleanup Jiri Slaby
2007-04-29 21:07 ` [PATCH 21/21] Char: cyclades, copyright and version changes Jiri Slaby
2007-05-02 15:57 ` [PATCH 1/21] Char: cyclades, use IS_CYC_Z macro Jiri Slaby
2007-05-02 19:47   ` Andrew Morton

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=1726067771982725064@wsc.cz \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.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.