From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Adam Belay <ambx1@neo.rr.com>
Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela <perex@suse.cz>,
Matthieu Castet <castet.matthieu@free.fr>,
Li Shaohua <shaohua.li@intel.com>, Andrew Morton <akpm@osdl.org>,
Phil Blundell <philb@gnu.org>, Tim Waugh <tim@cyberelk.net>,
Andrea Arcangeli <andrea@suse.de>,
linux-parport@lists.infradead.org
Subject: [PATCH 1/9] parport: adjust pnp_register_driver signature
Date: Thu, 2 Mar 2006 16:09:15 -0700 [thread overview]
Message-ID: <200603021609.15330.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <200603021601.27467.bjorn.helgaas@hp.com>
Remove the assumption that pnp_register_driver() returns the number of
devices claimed.
parport_pc_init() does nothing with "count", so remove it. Then nobody
uses the return value of parport_pc_find_ports(), so make it void.
Finally, update pnp_register_driver() usage.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Index: work-mm4/drivers/parport/parport_pc.c
===================================================================
--- work-mm4.orig/drivers/parport/parport_pc.c 2006-03-01 15:37:16.000000000 -0700
+++ work-mm4/drivers/parport/parport_pc.c 2006-03-02 12:41:33.000000000 -0700
@@ -3126,9 +3126,9 @@
* autoirq is PARPORT_IRQ_NONE, PARPORT_IRQ_AUTO, or PARPORT_IRQ_PROBEONLY
* autodma is PARPORT_DMA_NONE or PARPORT_DMA_AUTO
*/
-static int __init parport_pc_find_ports (int autoirq, int autodma)
+static void __init parport_pc_find_ports (int autoirq, int autodma)
{
- int count = 0, r;
+ int count = 0, err;
#ifdef CONFIG_PARPORT_PC_SUPERIO
detect_and_report_winbond ();
@@ -3140,23 +3140,17 @@
/* PnP ports, skip detection if SuperIO already found them */
if (!count) {
- r = pnp_register_driver (&parport_pc_pnp_driver);
- if (r >= 0) {
+ err = pnp_register_driver (&parport_pc_pnp_driver);
+ if (!err)
pnp_registered_parport = 1;
- count += r;
- }
}
/* ISA ports and whatever (see asm/parport.h). */
- count += parport_pc_find_nonpci_ports (autoirq, autodma);
-
- r = pci_register_driver (&parport_pc_pci_driver);
- if (r)
- return r;
- pci_registered_parport = 1;
- count += 1;
+ parport_pc_find_nonpci_ports (autoirq, autodma);
- return count;
+ err = pci_register_driver (&parport_pc_pci_driver);
+ if (!err)
+ pci_registered_parport = 1;
}
/*
@@ -3381,8 +3375,6 @@
static int __init parport_pc_init(void)
{
- int count = 0;
-
if (parse_parport_params())
return -EINVAL;
@@ -3395,12 +3387,11 @@
break;
if ((io_hi[i]) == PARPORT_IOHI_AUTO)
io_hi[i] = 0x400 + io[i];
- if (parport_pc_probe_port(io[i], io_hi[i],
- irqval[i], dmaval[i], NULL))
- count++;
+ parport_pc_probe_port(io[i], io_hi[i],
+ irqval[i], dmaval[i], NULL);
}
} else
- count += parport_pc_find_ports (irqval[0], dmaval[0]);
+ parport_pc_find_ports (irqval[0], dmaval[0]);
return 0;
}
next prev parent reply other threads:[~2006-03-02 23:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 23:01 [PATCH 0/9] PNP: " Bjorn Helgaas
2006-03-02 23:09 ` Bjorn Helgaas [this message]
2006-03-02 23:09 ` [PATCH 2/9] mpu401: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 3/9] cs4236: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 4/9] opl3sa2: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 5/9] ns558: " Bjorn Helgaas
2006-03-03 12:55 ` Vojtech Pavlik
2006-03-03 15:58 ` Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 6/9] i8042: " Bjorn Helgaas
2006-03-14 5:31 ` Dmitry Torokhov
2006-03-02 23:09 ` [PATCH 7/9] IRDA: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 8/9] cs4232: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 9/9] PNP: " Bjorn Helgaas
2006-03-14 6:19 ` [PATCH 0/9] " Adam Belay
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=200603021609.15330.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=akpm@osdl.org \
--cc=ambx1@neo.rr.com \
--cc=andrea@suse.de \
--cc=castet.matthieu@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parport@lists.infradead.org \
--cc=perex@suse.cz \
--cc=philb@gnu.org \
--cc=shaohua.li@intel.com \
--cc=tim@cyberelk.net \
/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
all inboxes | Powered by JetHome®