Skip to content

Commit

Permalink
staging: comedi: pcl726: 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 9526728 commit 44a6438
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/comedi/drivers/pcl726.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,13 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
iorange = board->io_range;
printk(KERN_WARNING "comedi%d: pcl726: board=%s, 0x%03lx ", dev->minor,
board->name, iobase);
if (!request_region(iobase, iorange, "pcl726")) {
if (!request_region(iobase, iorange, dev->board_name)) {
printk(KERN_WARNING "I/O port conflict\n");
return -EIO;
}

dev->iobase = iobase;

dev->board_name = board->name;

devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
if (!devpriv)
return -ENOMEM;
Expand All @@ -268,7 +266,7 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
irq = 0; /* Bad IRQ */
} else {
if (request_irq(irq, interrupt_pcl818, 0,
"pcl726", dev)) {
dev->board_name, dev)) {
printk(KERN_WARNING
", unable to allocate IRQ %d,"
" DISABLING IT", irq);
Expand Down

0 comments on commit 44a6438

Please sign in to comment.