staging: comedi: amplc_pci230: tidy up irq request
Clean up the irq request in the attach of this driver and remove the dev_{level} noise. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
95dc140a5e
commit
e10c19a83c
1 changed files with 11 additions and 16 deletions
|
@ -2633,7 +2633,7 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
struct comedi_subdevice *s;
|
struct comedi_subdevice *s;
|
||||||
unsigned long iobase1, iobase2;
|
unsigned long iobase1, iobase2;
|
||||||
/* PCI230's I/O spaces 1 and 2 respectively. */
|
/* PCI230's I/O spaces 1 and 2 respectively. */
|
||||||
int irq_hdl, rc;
|
int rc;
|
||||||
|
|
||||||
comedi_set_hw_dev(dev, &pci_dev->dev);
|
comedi_set_hw_dev(dev, &pci_dev->dev);
|
||||||
|
|
||||||
|
@ -2705,16 +2705,12 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
outw(devpriv->adcg, dev->iobase + PCI230_ADCG);
|
outw(devpriv->adcg, dev->iobase + PCI230_ADCG);
|
||||||
outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
|
outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
|
||||||
dev->iobase + PCI230_ADCCON);
|
dev->iobase + PCI230_ADCCON);
|
||||||
/* Register the interrupt handler. */
|
|
||||||
irq_hdl = request_irq(pci_dev->irq, pci230_interrupt,
|
if (pci_dev->irq) {
|
||||||
IRQF_SHARED, "amplc_pci230", dev);
|
rc = request_irq(pci_dev->irq, pci230_interrupt, IRQF_SHARED,
|
||||||
if (irq_hdl < 0) {
|
dev->board_name, dev);
|
||||||
dev_warn(dev->class_dev,
|
if (rc == 0)
|
||||||
"unable to register irq %u, commands will not be available\n",
|
dev->irq = pci_dev->irq;
|
||||||
pci_dev->irq);
|
|
||||||
} else {
|
|
||||||
dev->irq = pci_dev->irq;
|
|
||||||
dev_dbg(dev->class_dev, "registered irq %u\n", pci_dev->irq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = comedi_alloc_subdevices(dev, 3);
|
rc = comedi_alloc_subdevices(dev, 3);
|
||||||
|
@ -2730,14 +2726,14 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
s->range_table = &pci230_ai_range;
|
s->range_table = &pci230_ai_range;
|
||||||
s->insn_read = &pci230_ai_rinsn;
|
s->insn_read = &pci230_ai_rinsn;
|
||||||
s->len_chanlist = 256; /* but there are restrictions. */
|
s->len_chanlist = 256; /* but there are restrictions. */
|
||||||
/* Only register commands if the interrupt handler is installed. */
|
if (dev->irq) {
|
||||||
if (irq_hdl == 0) {
|
|
||||||
dev->read_subdev = s;
|
dev->read_subdev = s;
|
||||||
s->subdev_flags |= SDF_CMD_READ;
|
s->subdev_flags |= SDF_CMD_READ;
|
||||||
s->do_cmd = &pci230_ai_cmd;
|
s->do_cmd = &pci230_ai_cmd;
|
||||||
s->do_cmdtest = &pci230_ai_cmdtest;
|
s->do_cmdtest = &pci230_ai_cmdtest;
|
||||||
s->cancel = pci230_ai_cancel;
|
s->cancel = pci230_ai_cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = &dev->subdevices[1];
|
s = &dev->subdevices[1];
|
||||||
/* analog output subdevice */
|
/* analog output subdevice */
|
||||||
if (thisboard->ao_chans > 0) {
|
if (thisboard->ao_chans > 0) {
|
||||||
|
@ -2749,9 +2745,7 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
s->insn_write = &pci230_ao_winsn;
|
s->insn_write = &pci230_ao_winsn;
|
||||||
s->insn_read = &pci230_ao_rinsn;
|
s->insn_read = &pci230_ao_rinsn;
|
||||||
s->len_chanlist = thisboard->ao_chans;
|
s->len_chanlist = thisboard->ao_chans;
|
||||||
/* Only register commands if the interrupt handler is
|
if (dev->irq) {
|
||||||
* installed. */
|
|
||||||
if (irq_hdl == 0) {
|
|
||||||
dev->write_subdev = s;
|
dev->write_subdev = s;
|
||||||
s->subdev_flags |= SDF_CMD_WRITE;
|
s->subdev_flags |= SDF_CMD_WRITE;
|
||||||
s->do_cmd = &pci230_ao_cmd;
|
s->do_cmd = &pci230_ao_cmd;
|
||||||
|
@ -2761,6 +2755,7 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
} else {
|
} else {
|
||||||
s->type = COMEDI_SUBD_UNUSED;
|
s->type = COMEDI_SUBD_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = &dev->subdevices[2];
|
s = &dev->subdevices[2];
|
||||||
/* digital i/o subdevice */
|
/* digital i/o subdevice */
|
||||||
if (thisboard->have_dio) {
|
if (thisboard->have_dio) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue