linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jdthood@home.dhs.org (Thomas Hood)
To: linux-kernel@vger.kernel.org
Cc: jdthood@mail.com
Subject: [PATCH] parport_pc to use pnpbios_register_driver()
Date: Sat, 10 Nov 2001 00:36:33 -0500 (EST)	[thread overview]
Message-ID: <20011110053633.D7D8AB70@thanatos.toad.net> (raw)

Here's a patch to make parport_pc.c use pnpbios_register_driver()
instead of pnpbios_find_device.


--- linux-2.4.13-ac8_ORIG/drivers/parport/parport_pc.c	Fri Oct 26 18:13:48 2001
+++ linux-2.4.13-ac8/drivers/parport/parport_pc.c	Fri Nov  9 23:42:11 2001
@@ -2822,7 +2822,7 @@
 
 #define UNSET(res)   ((res).flags & IORESOURCE_UNSET)
 
-int init_pnp040x(struct pci_dev *dev)
+int init_PNP040x(struct pci_dev *dev)
 {
 	int io,iohi,irq,dma;
 
@@ -2879,6 +2879,28 @@
 
 #endif 
 
+#if defined (CONFIG_PNPBIOS) || defined (CONFIG_PNPBIOS_MODULE)
+static int pnpbios_probe_cb( struct pci_dev *dev, const struct pnpbios_device_id *id )
+{
+                return init_PNP040x(dev);
+}
+
+static struct pnpbios_device_id pnpdevs[] = {
+	/*  id, driver_data */
+	{ "PNP0400", 0L },
+	{ "PNP0401", 0L },
+	{ }
+};
+
+static struct pnpbios_driver pnpdrv = {
+	/* node     */ { },
+	/* name     */ "parport_pc",
+	/* id_table */ pnpdevs,
+	/* probe    */ pnpbios_probe_cb,
+	/* remove   */ NULL
+};
+#endif
+
 /* This function is called by parport_pc_init if the user didn't
  * specify any ports to probe.  Its job is to find some ports.  Order
  * is important here -- we want ISA ports to be registered first,
@@ -2892,7 +2914,6 @@
 static int __init parport_pc_find_ports (int autoirq, int autodma)
 {
 	int count = 0, r;
-	struct pci_dev *dev;
 
 #ifdef CONFIG_PARPORT_PC_SUPERIO
 	detect_and_report_winbond ();
@@ -2900,11 +2921,7 @@
 #endif
 
 #if defined (CONFIG_PNPBIOS) || defined (CONFIG_PNPBIOS_MODULE)
-	dev=NULL;
-	while ((dev=pnpbios_find_device("PNP0400",dev)))
-		count+=init_pnp040x(dev);
-        while ((dev=pnpbios_find_device("PNP0401",dev)))
-                count+=init_pnp040x(dev);
+	count += pnpbios_register_driver(&pnpdrv);
 #endif
 
 	/* Onboard SuperIO chipsets that show themselves on the PCI bus. */
@@ -3015,6 +3032,10 @@
 
 	if (!user_specified)
 		pci_unregister_driver (&parport_pc_pci_driver);
+
+#if defined (CONFIG_PNPBIOS) || defined (CONFIG_PNPBIOS_MODULE)
+	pnpbios_unregister_driver(&pnpdrv);
+#endif
 
 	while (p) {
 		tmp = p->next;

             reply	other threads:[~2001-11-10  5:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200111102104.fAAL4pk19362@spf4.us4.outblaze.com>
2001-11-10  5:36 ` Thomas Hood [this message]
2001-11-11  4:52   ` [PATCH] parport_pc to use pnpbios_register_driver() #2 Thomas Hood
2001-11-11 20:42   ` [PATCH] parport_pc to use pnpbios_register_driver() Kai Germaschewski
2001-11-12  1:56     ` Keith Owens
2001-11-12  8:30       ` Kai Germaschewski
2001-11-13 21:41         ` Thomas Hood
2001-11-14  9:25           ` Kai Germaschewski
2001-11-14 10:17             ` David Woodhouse
2001-11-15 13:30               ` [PATCH] parport_pc to use pnpbios_register_driver() #4 Thomas Hood
2001-11-14 15:46             ` [PATCH] parport_pc to use pnpbios_register_driver() Thomas Hood

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=20011110053633.D7D8AB70@thanatos.toad.net \
    --to=jdthood@home.dhs.org \
    --cc=jdthood@mail.com \
    --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).