提交 3e034797 编写于 作者: H H Hartley Sweeten 提交者: Greg Kroah-Hartman

staging: comedi: ni_labpc: pass the isr_flags to labpc_common_attach()

The PCI and PCMCIA LabPC boards use shared interrupts and need the
IRQF_SHARED flag set when requesting the irq, the ISA boards do not.

Instead of checking the 'bustype' in labpc_common_attach() in order
to determine the isr_flags, just pass the flags as a parameter to the
function.
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: NIan Abbott <abbotti@mev.co.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 76730884
...@@ -1588,12 +1588,11 @@ static int labpc_eeprom_insn_read(struct comedi_device *dev, ...@@ -1588,12 +1588,11 @@ static int labpc_eeprom_insn_read(struct comedi_device *dev,
} }
int labpc_common_attach(struct comedi_device *dev, int labpc_common_attach(struct comedi_device *dev,
unsigned int irq) unsigned int irq, unsigned long isr_flags)
{ {
const struct labpc_boardinfo *board = comedi_board(dev); const struct labpc_boardinfo *board = comedi_board(dev);
struct labpc_private *devpriv = dev->private; struct labpc_private *devpriv = dev->private;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned long isr_flags;
int ret; int ret;
int i; int i;
...@@ -1616,10 +1615,6 @@ int labpc_common_attach(struct comedi_device *dev, ...@@ -1616,10 +1615,6 @@ int labpc_common_attach(struct comedi_device *dev,
} }
if (irq) { if (irq) {
isr_flags = 0;
if (board->bustype == pci_bustype ||
board->bustype == pcmcia_bustype)
isr_flags |= IRQF_SHARED;
ret = request_irq(irq, labpc_interrupt, isr_flags, ret = request_irq(irq, labpc_interrupt, isr_flags,
dev->board_name, dev); dev->board_name, dev);
if (ret == 0) if (ret == 0)
...@@ -1738,7 +1733,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -1738,7 +1733,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret) if (ret)
return ret; return ret;
ret = labpc_common_attach(dev, irq); ret = labpc_common_attach(dev, irq, 0);
if (ret) if (ret)
return ret; return ret;
......
...@@ -101,7 +101,7 @@ struct labpc_private { ...@@ -101,7 +101,7 @@ struct labpc_private {
}; };
int labpc_common_attach(struct comedi_device *dev, int labpc_common_attach(struct comedi_device *dev,
unsigned int irq); unsigned int irq, unsigned long isr_flags);
void labpc_common_detach(struct comedi_device *dev); void labpc_common_detach(struct comedi_device *dev);
extern const int labpc_1200_ai_gain_bits[]; extern const int labpc_1200_ai_gain_bits[];
......
...@@ -111,7 +111,7 @@ static int labpc_auto_attach(struct comedi_device *dev, ...@@ -111,7 +111,7 @@ static int labpc_auto_attach(struct comedi_device *dev,
return -ENOMEM; return -ENOMEM;
dev->private = devpriv; dev->private = devpriv;
return labpc_common_attach(dev, link->irq); return labpc_common_attach(dev, link->irq, IRQF_SHARED);
} }
static void labpc_detach(struct comedi_device *dev) static void labpc_detach(struct comedi_device *dev)
......
...@@ -92,7 +92,7 @@ static int labpc_pci_auto_attach(struct comedi_device *dev, ...@@ -92,7 +92,7 @@ static int labpc_pci_auto_attach(struct comedi_device *dev,
return ret; return ret;
dev->iobase = (unsigned long)devpriv->mite->daq_io_addr; dev->iobase = (unsigned long)devpriv->mite->daq_io_addr;
return labpc_common_attach(dev, mite_irq(devpriv->mite)); return labpc_common_attach(dev, mite_irq(devpriv->mite), IRQF_SHARED);
} }
static void labpc_pci_detach(struct comedi_device *dev) static void labpc_pci_detach(struct comedi_device *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册