parport: serial: Get rid of IRQ_NONE abuse
PATCH 1/2 parport: serial: Get rid of IRQ_NONE abuse
IRQ_NONE definition is solely for IRQ handlers and not for generic probe code. Replace it with plain integer.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/parport/parport_serial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/parport/parport_serial.c +3 -2
@@ -607,11 +607,12 @@ static int parport_register(struct pci_dev *dev, const struct pci_device_id *id)def.) */ /* TODO: test if sharing interrupts works */ irq = dev->irq; -if (irq ==IRQ_NONE ) { +if (irq ==0 ) + irq =PARPORT_IRQ_NONE ; +if (irq ==PARPORT_IRQ_NONE ) {dev_dbg (&dev->dev,"PCI parallel port detected: I/O at %#lx(%#lx)\n" , io_lo, io_hi); - irq =PARPORT_IRQ_NONE ; }else { dev_dbg(&dev->dev, "PCI parallel port detected: I/O at %#lx(%#lx), IRQ %d\n",
Signature · 1 line
2.30.2
PATCH 2/2 parport: serial: Retrieve IRQ vector with help of special getter
pci_irq_vector() may be used to retrieve IRQ vector for a PCI device. Use it instead of direct access.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/parport/parport_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/parport/parport_serial.c +3 -1
@@ -606,7 +606,9 @@ static int parport_register(struct pci_dev *dev, const struct pci_device_id *id)"hi" as an offset (see SYBA def.) */ /* TODO: test if sharing interrupts works */ - irq = dev->irq; + irq =pci_irq_vector (dev,0 ); +if (irq <0 ) +return irq;if (irq ==0 ) irq =PARPORT_IRQ_NONE ;if (irq ==PARPORT_IRQ_NONE ) {
Signature · 1 line
2.30.2
Re: [PATCH v1 2/2] parport: serial: Retrieve IRQ vector with help of special getter
Thanks Andy.
Quoted 4 lines · Andy Shevchenko
pci_irq_vector()may be used to retrieve IRQ vector for a PCI device. Use it instead of direct access.Signed-off-by Andy Shevchenko <[email protected]>
For both the patches,
Acked-by Sudip Mukherjee <[email protected]>
Greg, can you please take them.
--
Regards
Sudip