Skip to content

Commit

Permalink
staging: comedi: rti800: cleanup dev->board_name usage
Browse files Browse the repository at this point in the history
The comedi core initializes the dev->board_name before calling the
driver (*attach) function. There is not reason to reinitialize it
in the driver.

Use the dev->board_name when doing the request_{region,irq}() instead
of the open-coded string.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 9, 2013
1 parent 62d4d56 commit 7b2234d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/staging/comedi/drivers/rti800.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
struct comedi_subdevice *s;

iobase = it->options[0];
if (!request_region(iobase, RTI800_SIZE, "rti800"))
if (!request_region(iobase, RTI800_SIZE, dev->board_name))
return -EIO;
dev->iobase = iobase;

Expand All @@ -319,14 +319,13 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)

irq = it->options[1];
if (irq) {
ret = request_irq(irq, rti800_interrupt, 0, "rti800", dev);
ret = request_irq(irq, rti800_interrupt, 0, dev->board_name,
dev);
if (ret < 0)
return ret;
dev->irq = irq;
}

dev->board_name = board->name;

ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;
Expand Down

0 comments on commit 7b2234d

Please sign in to comment.