Skip to content

Commit

Permalink
staging: comedi: pcl711: cleanup dev->board_name usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent f375ac5 commit 814c219
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/staging/comedi/drivers/pcl711.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,24 +459,21 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)

iobase = it->options[0];
printk(KERN_INFO "comedi%d: pcl711: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, PCL711_SIZE, "pcl711")) {
if (!request_region(iobase, PCL711_SIZE, dev->board_name)) {
printk("I/O port conflict\n");
return -EIO;
}
dev->iobase = iobase;

/* there should be a sanity check here */

dev->board_name = board->name;

/* grab our IRQ */
irq = it->options[1];
if (irq > board->maxirq) {
printk(KERN_ERR "irq out of range\n");
return -EINVAL;
}
if (irq) {
if (request_irq(irq, pcl711_interrupt, 0, "pcl711", dev)) {
if (request_irq(irq, pcl711_interrupt, 0, dev->board_name,
dev)) {
printk(KERN_ERR "unable to allocate irq %u\n", irq);
return -EINVAL;
} else {
Expand Down

0 comments on commit 814c219

Please sign in to comment.