aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-05-23 12:55:48 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-30 20:40:58 +0900
commit137beb77c7ce3326f78622f8a309b3c8752b0e62 (patch)
tree377ae61a801df81721ad8b3d172807a561b3fcc9 /drivers
parent1fc56e86e49c93e426937377fc485734a81870da (diff)
staging: comedi: usbduxsigma: move usb_set_intfdata(intf, NULL) to (*detach)
For aesthetic reasons, move the clearing of the interface data to the (*detach) since its set in the (*auto_attach). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/drivers/usbduxsigma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index b879965565ad..30ada7d8d935 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -1521,10 +1521,6 @@ static void tidy_up(struct usbduxsigma_private *usbduxsub_tmp)
{
int i;
- /* shows the usb subsystem that the driver is down */
- if (usbduxsub_tmp->interface)
- usb_set_intfdata(usbduxsub_tmp->interface, NULL);
-
if (usbduxsub_tmp->urbIn) {
/* force unlink all urbs */
usbdux_ai_stop(usbduxsub_tmp, 1);
@@ -1847,6 +1843,7 @@ static int usbduxsigma_auto_attach(struct comedi_device *dev,
static void usbduxsigma_detach(struct comedi_device *dev)
{
+ struct usb_interface *intf = comedi_to_usb_interface(dev);
struct usbduxsigma_private *devpriv = dev->private;
if (!devpriv)
@@ -1856,6 +1853,8 @@ static void usbduxsigma_detach(struct comedi_device *dev)
usbdux_ai_stop(devpriv, devpriv->ai_cmd_running);
usbdux_ao_stop(devpriv, devpriv->ao_cmd_running);
+ usb_set_intfdata(intf, NULL);
+
down(&devpriv->sem);
tidy_up(devpriv);
up(&devpriv->sem);