Commit b105ad8a authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: vmk80xx: remove private data 'probed'

The 'probed' variable is used in the usb driver (*probe) to detect an
unused element in the static private data arry. This variable is then
set after the usb driver has completed its (*probe) before calling
comedi_usb_auto_config(). When the comedi core does the auto config
it will call the (*auto_attach) function, vmk80xx_auto_attach(), which
then locates the correct private data in the static array by checking
to see if it has been 'probed' and that the 'intf' variable matches
the usb_interface pointer for the usb device.

Now that the private data is clean after failed usb probes and disconnects
we don't have to worry about have a garbage 'intf' value in the private
data that might match.

Remove the 'probed' flag from the private data and just use the 'intf'
pointer to detect the match.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db7dabf7
...@@ -210,7 +210,6 @@ struct vmk80xx_private { ...@@ -210,7 +210,6 @@ struct vmk80xx_private {
unsigned char *usb_rx_buf; unsigned char *usb_rx_buf;
unsigned char *usb_tx_buf; unsigned char *usb_tx_buf;
unsigned long flags; unsigned long flags;
int probed;
int attached; int attached;
}; };
...@@ -529,8 +528,6 @@ static int rudimentary_check(struct vmk80xx_private *devpriv, int dir) ...@@ -529,8 +528,6 @@ static int rudimentary_check(struct vmk80xx_private *devpriv, int dir)
{ {
if (!devpriv) if (!devpriv)
return -EFAULT; return -EFAULT;
if (!devpriv->probed)
return -ENODEV;
if (!devpriv->attached) if (!devpriv->attached)
return -ENODEV; return -ENODEV;
if (dir & DIR_IN) { if (dir & DIR_IN) {
...@@ -1299,7 +1296,7 @@ static int vmk80xx_auto_attach(struct comedi_device *dev, ...@@ -1299,7 +1296,7 @@ static int vmk80xx_auto_attach(struct comedi_device *dev,
mutex_lock(&glb_mutex); mutex_lock(&glb_mutex);
for (i = 0; i < VMK80XX_MAX_BOARDS; i++) for (i = 0; i < VMK80XX_MAX_BOARDS; i++)
if (vmb[i].probed && vmb[i].intf == intf) if (vmb[i].intf == intf)
break; break;
if (i == VMK80XX_MAX_BOARDS) if (i == VMK80XX_MAX_BOARDS)
ret = -ENODEV; ret = -ENODEV;
...@@ -1361,7 +1358,7 @@ static int vmk80xx_usb_probe(struct usb_interface *intf, ...@@ -1361,7 +1358,7 @@ static int vmk80xx_usb_probe(struct usb_interface *intf,
mutex_lock(&glb_mutex); mutex_lock(&glb_mutex);
for (i = 0; i < VMK80XX_MAX_BOARDS; i++) for (i = 0; i < VMK80XX_MAX_BOARDS; i++)
if (!vmb[i].probed) if (!vmb[i].intf)
break; break;
if (i == VMK80XX_MAX_BOARDS) { if (i == VMK80XX_MAX_BOARDS) {
...@@ -1409,8 +1406,6 @@ static int vmk80xx_usb_probe(struct usb_interface *intf, ...@@ -1409,8 +1406,6 @@ static int vmk80xx_usb_probe(struct usb_interface *intf,
if (boardinfo->model == VMK8055_MODEL) if (boardinfo->model == VMK8055_MODEL)
vmk80xx_reset_device(devpriv); vmk80xx_reset_device(devpriv);
devpriv->probed = 1;
mutex_unlock(&glb_mutex); mutex_unlock(&glb_mutex);
comedi_usb_auto_config(intf, &vmk80xx_driver); comedi_usb_auto_config(intf, &vmk80xx_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment