diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-03-22 09:46:05 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 11:41:51 -0700 |
commit | 7b09c9f63d70cf9aa54455b22f3f9e0df596d8c2 (patch) | |
tree | b52d965e357f06f58bd59a7b4273ffe450b180dd | |
parent | cacedd0ce5f3482574dd18ce218a3f4440b4c828 (diff) | |
download | op-kernel-dev-7b09c9f63d70cf9aa54455b22f3f9e0df596d8c2.zip op-kernel-dev-7b09c9f63d70cf9aa54455b22f3f9e0df596d8c2.tar.gz |
staging: comedi: ni_labpc: use dev->board_name instead of DRV_NAME
In labpc_common_attach(), initialize the dev->board_name early and
use that instead of DRV_NAME when allocating the resources.
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>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index 2c932e6..887fa8c 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -1672,7 +1672,9 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, int ret; int i; - dev_info(dev->class_dev, "ni_labpc: %s\n", board->name); + dev->board_name = board->name; + + dev_info(dev->class_dev, "ni_labpc: %s\n", dev->board_name); if (iobase == 0) { dev_err(dev->class_dev, "io base address is zero!\n"); return -EINVAL; @@ -1680,7 +1682,7 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, /* request io regions for isa boards */ if (board->bustype == isa_bustype) { /* check if io addresses are available */ - if (!request_region(iobase, LABPC_SIZE, DRV_NAME)) { + if (!request_region(iobase, LABPC_SIZE, dev->board_name)) { dev_err(dev->class_dev, "I/O port conflict\n"); return -EIO; } @@ -1711,7 +1713,7 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, board->bustype == pcmcia_bustype) isr_flags |= IRQF_SHARED; if (request_irq(irq, labpc_interrupt, isr_flags, - DRV_NAME, dev)) { + dev->board_name, dev)) { dev_err(dev->class_dev, "unable to allocate irq %u\n", irq); return -EINVAL; @@ -1733,7 +1735,7 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, if (devpriv->dma_buffer == NULL) return -ENOMEM; - if (request_dma(dma_chan, DRV_NAME)) { + if (request_dma(dma_chan, dev->board_name)) { dev_err(dev->class_dev, "failed to allocate dma channel %u\n", dma_chan); @@ -1747,8 +1749,6 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, } #endif - dev->board_name = board->name; - ret = comedi_alloc_subdevices(dev, 5); if (ret) return ret; |