summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/ni_labpc_pci.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-06-20 11:10:35 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-29 14:17:59 -0700
commitb876e985c2273b7bd2d5539f2147ef69f7701129 (patch)
tree8172ce048677be90027aedcbe7c53e03055e0f41 /drivers/staging/comedi/drivers/ni_labpc_pci.c
parent9086689676f63f51fbec73245c2b8c847b0f1cbb (diff)
staging: comedi: mite: cleanup mite_unsetup()
This function is only called by comedi drivers during the (*detach) of the driver. After it is called mite_free() is always called to kfree the allocated mite_struct pointer. Rename this function to mite_detach() and merge the kfree() from mite_free() into it. Remove the unnecessary clearing of the mite variables since the mite pointer is going to be kfree()'d anyway. The mite_detach() function checks if the pointer is valid so remove the unnecessary checks in the callers. The check can also be removed in ni_660x since the ni_660x_free_mite_rings() function does not actually need the 'mite' pointer. 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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_pci.c b/drivers/staging/comedi/drivers/ni_labpc_pci.c
index 384c427092e4..358c4af3e174 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_pci.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_pci.c
@@ -91,10 +91,8 @@ static void labpc_pci_detach(struct comedi_device *dev)
{
struct labpc_private *devpriv = dev->private;
- if (devpriv && devpriv->mite) {
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
+ if (devpriv)
+ mite_detach(devpriv->mite);
if (dev->irq)
free_irq(dev->irq, dev);
comedi_pci_disable(dev);