staging: comedi: pcl812: 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
6f9aa29b47
commit
4ab195e0ce
1 changed files with 4 additions and 6 deletions
|
@ -1133,7 +1133,7 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
printk(KERN_INFO "comedi%d: pcl812: board=%s, ioport=0x%03lx",
|
printk(KERN_INFO "comedi%d: pcl812: board=%s, ioport=0x%03lx",
|
||||||
dev->minor, board->name, iobase);
|
dev->minor, board->name, iobase);
|
||||||
|
|
||||||
if (!request_region(iobase, board->io_range, "pcl812")) {
|
if (!request_region(iobase, board->io_range, dev->board_name)) {
|
||||||
printk("I/O port conflict\n");
|
printk("I/O port conflict\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
@ -1146,8 +1146,6 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
}
|
}
|
||||||
dev->private = devpriv;
|
dev->private = devpriv;
|
||||||
|
|
||||||
dev->board_name = board->name;
|
|
||||||
|
|
||||||
irq = 0;
|
irq = 0;
|
||||||
if (board->IRQbits != 0) { /* board support IRQ */
|
if (board->IRQbits != 0) { /* board support IRQ */
|
||||||
irq = it->options[1];
|
irq = it->options[1];
|
||||||
|
@ -1158,8 +1156,8 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
"DISABLING IT", irq);
|
"DISABLING IT", irq);
|
||||||
irq = 0; /* Bad IRQ */
|
irq = 0; /* Bad IRQ */
|
||||||
} else {
|
} else {
|
||||||
if (request_irq
|
if (request_irq(irq, interrupt_pcl812, 0,
|
||||||
(irq, interrupt_pcl812, 0, "pcl812", dev)) {
|
dev->board_name, dev)) {
|
||||||
printk
|
printk
|
||||||
(", unable to allocate IRQ %u, "
|
(", unable to allocate IRQ %u, "
|
||||||
"DISABLING IT", irq);
|
"DISABLING IT", irq);
|
||||||
|
@ -1183,7 +1181,7 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
printk(", DMA is out of allowed range, FAIL!\n");
|
printk(", DMA is out of allowed range, FAIL!\n");
|
||||||
return -EINVAL; /* Bad DMA */
|
return -EINVAL; /* Bad DMA */
|
||||||
}
|
}
|
||||||
ret = request_dma(dma, "pcl812");
|
ret = request_dma(dma, dev->board_name);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk(KERN_ERR ", unable to allocate DMA %u, FAIL!\n",
|
printk(KERN_ERR ", unable to allocate DMA %u, FAIL!\n",
|
||||||
dma);
|
dma);
|
||||||
|
|
Loading…
Add table
Reference in a new issue