Skip to content

Commit

Permalink
staging: comedi: dt2811: 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 5e15089 commit 3871a75
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/staging/comedi/drivers/dt2811.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ Configuration options:

#include <linux/ioport.h>

static const char *driver_name = "dt2811";

static const struct comedi_lrange range_dt2811_pgh_ai_5_unipolar = {
4, {
RANGE(0, 5),
Expand Down Expand Up @@ -407,13 +405,12 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)

printk(KERN_INFO "comedi%d: dt2811:base=0x%04lx\n", dev->minor, iobase);

if (!request_region(iobase, DT2811_SIZE, driver_name)) {
if (!request_region(iobase, DT2811_SIZE, dev->board_name)) {
printk(KERN_ERR "I/O port conflict\n");
return -EIO;
}

dev->iobase = iobase;
dev->board_name = board->name;

#if 0
outb(0, dev->iobase + DT2811_ADCSR);
Expand Down Expand Up @@ -449,7 +446,7 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
i = inb(dev->iobase + DT2811_ADDATHI);
printk(KERN_INFO "(irq = %d)\n", irq);
ret = request_irq(irq, dt2811_interrupt, 0,
driver_name, dev);
dev->board_name, dev);
if (ret < 0)
return -EIO;
dev->irq = irq;
Expand Down

0 comments on commit 3871a75

Please sign in to comment.