Skip to contentSkip to conversation

parport_pc.c PnP BIOS sanity check

PATCH Thomas Hood 1 participant 1 message Aug 13, 2001 Parallel port

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Alan Cox

IRQ 0 is a legal valid IRQ. I suspect the problem is that pnpbios shouldnt be reporting an IRQ or we should be using some kind of NO_IRQ cookie

Okay, I accept that. Then must we also say that DMA 0 is a valid DMA? If so, then unless I'm confused about something the rejection of dma==0 should be eliminated:
--------------------------------------------------------------------------------

drivers/parport/parport_pc.c Mon Aug 13 17:40:38 2001 renamed from drivers/parport/parport_pc.c_ORIG Fri Aug 10 18:19:07 2001 +0 -2
@@ -2797,8 +2797,6 @@
        irq=dev->irq_resource[0].start;
        dma=dev->dma_resource[0].start;
 
-       if (dma==0) dma=-1;
-
        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))

--------------------------------------------------------------------------------

Otherwise I think the following change should be made for the sake of code clarity. (PARPORT_DMA_NONE is defined as -1.)
--------------------------------------------------------------------------------

drivers/parport/parport_pc.c Fri Aug 10 18:19:55 2001 renamed from drivers/parport/parport_pc.c_ORIG Fri Aug 10 18:19:07 2001 +1 -1
@@ -2797,7 +2797,7 @@
        irq=dev->irq_resource[0].start;
        dma=dev->dma_resource[0].start;
 
-       if (dma==0) dma=-1;
+       if (dma==0) dma=PARPORT_DMA_NONE;
 
        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);

--------------------------------------------------------------------------------

--
Thomas Hood
jdthood_AT_yahoo.co.uk

drivers/parport/parport_pc.c renamed from drivers/parport/parport_pc.c_ORIG +0 -2
@@ -2797,8 +2797,6 @@
 	irq=dev->irq_resource[0].start;
 	dma=dev->dma_resource[0].start;
 
-	if (dma==0) dma=-1;
-
 	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))
drivers/parport/parport_pc.c renamed from drivers/parport/parport_pc.c_ORIG +1 -1
@@ -2797,7 +2797,7 @@
 	irq=dev->irq_resource[0].start;
 	dma=dev->dma_resource[0].start;
 
-	if (dma==0) dma=-1;
+	if (dma==0) dma=PARPORT_DMA_NONE;
 
 	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);