staging: comedi: usbduxfast: remove impossible 'if (!devpriv)' checks

The private data 'devpriv' is allocated in the (*auto_attach) before
the subdevices are initialized and the (*auto_attach) has to complete
successfully before the core will call any of the subdevice operations.
Because of this the (!devpriv) checks in the subdevice code can never
fail. Remove them.

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>
This commit is contained in:
H Hartley Sweeten
2015-08-24 10:13:56 -07:00
committed by Greg Kroah-Hartman
parent db1876ff1e
commit fd9fe1fc1c

View File

@@ -223,9 +223,6 @@ static int usbduxfast_ai_cancel(struct comedi_device *dev,
struct usbduxfast_private *devpriv = dev->private;
int ret;
if (!devpriv)
return -EFAULT;
down(&devpriv->sem);
ret = usbduxfast_ai_stop(dev, 1);
up(&devpriv->sem);
@@ -317,9 +314,6 @@ static int usbduxfast_submit_urb(struct comedi_device *dev)
struct usbduxfast_private *devpriv = dev->private;
int ret;
if (!devpriv)
return -EFAULT;
usb_fill_bulk_urb(devpriv->urb, usb, usb_rcvbulkpipe(usb, BULKINEP),
devpriv->inbuf, SIZEINBUF,
usbduxfast_ai_interrupt, dev);
@@ -466,9 +460,6 @@ static int usbduxfast_ai_inttrig(struct comedi_device *dev,
struct comedi_cmd *cmd = &s->async->cmd;
int ret;
if (!devpriv)
return -EFAULT;
if (trig_num != cmd->start_arg)
return -EINVAL;
@@ -501,9 +492,6 @@ static int usbduxfast_ai_cmd(struct comedi_device *dev,
int result;
long steps, steps_tmp;
if (!devpriv)
return -EFAULT;
down(&devpriv->sem);
if (devpriv->ai_cmd_running) {
dev_err(dev->class_dev, "ai_cmd not possible\n");