From: Thomas Hood <jdthood@mail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.4.10-ac8 parport_pc fix
Date: 07 Oct 2001 22:02:15 -0400 [thread overview]
Message-ID: <1002506536.848.103.camel@thanatos> (raw)
Here is a patch for the 2.4.10-ac8 parport_pc driver.
Now that the PnP BIOS driver tells the difference between a
device's not using a resource type, its use of that resource
type being disabled, and its use of that resource with number
zero, we can modify the parport_pc driver to interpret and
report that information correctly.
This patch is independent of the PnP BIOS driver patches
I just submitted.
// Thomas
The patch:
--- linux-2.4.10-ac8/drivers/parport/parport_pc.c Sun Oct 7 14:38:44 2001
+++ linux-2.4.10-ac8-fix/drivers/parport/parport_pc.c Sun Oct 7 15:37:44 2001
@@ -2799,22 +2799,62 @@
#if defined (CONFIG_PNPBIOS) || defined (CONFIG_PNPBIOS_MODULE)
+#define UNSET(res) ((res).flags & IORESOURCE_UNSET)
+
int init_pnp040x(struct pci_dev *dev)
-{ int io,iohi,irq,dma;
+{
+ int io,iohi,irq,dma;
+
+ printk(KERN_INFO
+ "parport: PnP BIOS reports device %s %s (node number 0x%x) is ",
+ dev->name, dev->slot_name, dev->devfn
+ );
+
+ if ( UNSET(dev->resource[0]) ) {
+ printk("not configured.\n");
+ return 0;
+ }
+ io = dev->resource[0].start;
+ printk("configured to use io 0x%04x",io);
+ if ( UNSET(dev->resource[1]) ) {
+ iohi = 0;
+ } else {
+ iohi = dev->resource[1].start;
+ printk(", io 0x%04x",iohi);
+ }
- io=dev->resource[0].start;
- iohi=dev->resource[1].start;
- irq=dev->irq_resource[0].start;
- dma=dev->dma_resource[0].start;
+ if ( UNSET(dev->irq_resource[0]) ) {
+ irq = PARPORT_IRQ_NONE;
+ } else {
+ if ( dev->irq_resource[0].start == -1 ) {
+ irq = PARPORT_IRQ_NONE;
+ printk(", irq disabled");
+ } else {
+ irq = dev->irq_resource[0].start;
+ printk(", irq %d",irq);
+ }
+ }
- if(dma==0) dma=-1;
+ if ( UNSET(dev->dma_resource[0]) ) {
+ dma = PARPORT_DMA_NONE;
+ } else {
+ if ( dev->dma_resource[0].start == -1 ) {
+ dma = PARPORT_DMA_NONE;
+ printk(", dma disabled");
+ } else {
+ dma = dev->dma_resource[0].start;
+ printk(", dma %d",irq);
+ }
+ }
+
+ printk("\n");
- printk(KERN_INFO "PnPBIOS: Parport found %s %s at io=%04x,%04x irq=%d dma=%d\n",
- dev->name,dev->slot_name,io,iohi,irq,dma);
if (parport_pc_probe_port(io,iohi,irq,dma,NULL))
return 1;
+
return 0;
}
+#undef UNSET
#endif
reply other threads:[~2001-10-08 2:02 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=1002506536.848.103.camel@thanatos \
--to=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