staging: comedi: amplc_pc236: set board_name before common attach
For PCI boards, the `auto_attach` handler, `pc236_auto_attach()`, initializes `dev->board_ptr` to point to a `struct pc236_board`, but leaves `dev->board_name` unchanged. The Comedi core will have initialized `dev->board_name` to the `driver_name` string member of `amplc_pc236_driver`. For consistency with ISA boards manually configured by the `COMEDI_DEVCONFIG` ioctl via the legacy `attach` handler, `pc236_attach()`, set `dev->board_name` to the `name` member of the `struct pc236_board` pointed to by `dev->board_ptr`. Both `pc236_attach()` and `pc236_auto_attach()` call `pc236_common_attach()`, which also sets `dev->board_name` to the `name` member of the `struct pc236_board`. Since this assignment no longer changes anything, remove it. A nice side-effect of this change is that the same owner name string is used for requesting I/O regions (before the call the `pc236_common_attach()`) as is used for requesting the IRQ handler (during the call to `pc236_common_attach()`). It was already the same for (manually configured) ISA boards, but is now the same for (automatically configured) PCI boards. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
62b5e46322
commit
982e2bc487
1 changed files with 1 additions and 2 deletions
|
@ -284,11 +284,9 @@ static irqreturn_t pc236_interrupt(int irq, void *d)
|
||||||
static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
|
static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
|
||||||
unsigned int irq, unsigned long req_irq_flags)
|
unsigned int irq, unsigned long req_irq_flags)
|
||||||
{
|
{
|
||||||
const struct pc236_board *thisboard = comedi_board(dev);
|
|
||||||
struct comedi_subdevice *s;
|
struct comedi_subdevice *s;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dev->board_name = thisboard->name;
|
|
||||||
dev->iobase = iobase;
|
dev->iobase = iobase;
|
||||||
|
|
||||||
ret = comedi_alloc_subdevices(dev, 2);
|
ret = comedi_alloc_subdevices(dev, 2);
|
||||||
|
@ -362,6 +360,7 @@ static int pc236_auto_attach(struct comedi_device *dev,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
dev->board_ptr = &pc236_pci_board;
|
dev->board_ptr = &pc236_pci_board;
|
||||||
|
dev->board_name = pc236_pci_board.name;
|
||||||
ret = comedi_pci_enable(dev);
|
ret = comedi_pci_enable(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue