staging: comedi: pcl818: cleanup dev->board_name usage
This legacy driver does no additional probing so the dev->board_name will already be properly initialized by the comedi core before calling the (*attach) function. Remove the unnecessary initialization of dev->board_name and use it when requesting the resources instead of the open-coded strings. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
22b580f07e
commit
b27cc4135c
1 changed files with 4 additions and 6 deletions
|
@ -1616,7 +1616,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
devpriv->io_range = PCLx1xFIFO_RANGE;
|
devpriv->io_range = PCLx1xFIFO_RANGE;
|
||||||
devpriv->usefifo = 1;
|
devpriv->usefifo = 1;
|
||||||
}
|
}
|
||||||
if (!request_region(iobase, devpriv->io_range, "pcl818")) {
|
if (!request_region(iobase, devpriv->io_range, dev->board_name)) {
|
||||||
comedi_error(dev, "I/O port conflict\n");
|
comedi_error(dev, "I/O port conflict\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
@ -1628,8 +1628,6 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev->board_name = board->name;
|
|
||||||
|
|
||||||
/* grab our IRQ */
|
/* grab our IRQ */
|
||||||
irq = 0;
|
irq = 0;
|
||||||
if (board->IRQbits != 0) { /* board support IRQ */
|
if (board->IRQbits != 0) { /* board support IRQ */
|
||||||
|
@ -1641,8 +1639,8 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
irq);
|
irq);
|
||||||
irq = 0; /* Bad IRQ */
|
irq = 0; /* Bad IRQ */
|
||||||
} else {
|
} else {
|
||||||
if (request_irq
|
if (request_irq(irq, interrupt_pcl818, 0,
|
||||||
(irq, interrupt_pcl818, 0, "pcl818", dev)) {
|
dev->board_name, dev)) {
|
||||||
printk
|
printk
|
||||||
(", unable to allocate IRQ %u, DISABLING IT",
|
(", unable to allocate IRQ %u, DISABLING IT",
|
||||||
irq);
|
irq);
|
||||||
|
@ -1707,7 +1705,7 @@ no_rtc:
|
||||||
printk(KERN_ERR "DMA is out of allowed range, FAIL!\n");
|
printk(KERN_ERR "DMA is out of allowed range, FAIL!\n");
|
||||||
return -EINVAL; /* Bad DMA */
|
return -EINVAL; /* Bad DMA */
|
||||||
}
|
}
|
||||||
ret = request_dma(dma, "pcl818");
|
ret = request_dma(dma, dev->board_name);
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EBUSY; /* DMA isn't free */
|
return -EBUSY; /* DMA isn't free */
|
||||||
devpriv->dma = dma;
|
devpriv->dma = dma;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue