diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2015-01-21 15:11:44 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-25 19:59:12 +0800 |
commit | 83d682bda16b515c61a99ff830964c1461b837a2 (patch) | |
tree | e9cdc493d631bb4dd691ae5273dded6d1084712c /drivers/staging/comedi/drivers/ni_labpc_pci.c | |
parent | c0e4a8decb2e519789537896d2f75ef979e8cf05 (diff) |
staging: comedi: ni_labpc_common: move comedi_alloc_devpriv() to common code
The ni_labpc_common module is used by the ni_labpc, ni_labpc_pci, and ni_labpc_cs
drivers to provide the common code support. Those drivers currently all call
comedi_alloc_devpriv() to allocate the private data before calling the common
attach function.
For aesthetics, move the private data allocation into the common code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/ni_labpc_pci.c')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_pci.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_pci.c b/drivers/staging/comedi/drivers/ni_labpc_pci.c index a9f408a517e3..0407ff681dfd 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_pci.c +++ b/drivers/staging/comedi/drivers/ni_labpc_pci.c @@ -79,7 +79,6 @@ static int labpc_pci_auto_attach(struct comedi_device *dev, { struct pci_dev *pcidev = comedi_to_pci_dev(dev); const struct labpc_boardinfo *board = NULL; - struct labpc_private *devpriv; int ret; if (context < ARRAY_SIZE(labpc_pci_boards)) @@ -101,10 +100,6 @@ static int labpc_pci_auto_attach(struct comedi_device *dev, if (!dev->mmio) return -ENOMEM; - devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv)); - if (!devpriv) - return -ENOMEM; - return labpc_common_attach(dev, pcidev->irq, IRQF_SHARED); } |