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

staging: comedi: dt3000: change return type of dt3k_send_cmd to void

None of the callers check the return value. Just make it a void.

Flip the status check at the end of the function to check for an
error before outputing the dev_dbg(). Use __func__ for the function
name in the message.
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 d3bf2177
...@@ -280,7 +280,7 @@ static void debug_intr_flags(unsigned int flags) ...@@ -280,7 +280,7 @@ static void debug_intr_flags(unsigned int flags)
#define TIMEOUT 100 #define TIMEOUT 100
static int dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) static void dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd)
{ {
struct dt3k_private *devpriv = dev->private; struct dt3k_private *devpriv = dev->private;
int i; int i;
...@@ -294,13 +294,10 @@ static int dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd) ...@@ -294,13 +294,10 @@ static int dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd)
break; break;
udelay(1); udelay(1);
} }
if ((status & DT3000_COMPLETION_MASK) == DT3000_NOERROR)
return 0;
dev_dbg(dev->class_dev, "dt3k_send_cmd() timeout/error status=0x%04x\n", if ((status & DT3000_COMPLETION_MASK) != DT3000_NOERROR)
status); dev_dbg(dev->class_dev, "%s: timeout/error status=0x%04x\n",
__func__, status);
return -ETIME;
} }
static unsigned int dt3k_readsingle(struct comedi_device *dev, static unsigned int dt3k_readsingle(struct comedi_device *dev,
...@@ -365,10 +362,9 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev, ...@@ -365,10 +362,9 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev,
static int dt3k_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) static int dt3k_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct dt3k_private *devpriv = dev->private; struct dt3k_private *devpriv = dev->private;
int ret;
writew(SUBS_AI, devpriv->io_addr + DPR_SubSys); writew(SUBS_AI, devpriv->io_addr + DPR_SubSys);
ret = dt3k_send_cmd(dev, CMD_STOP); dt3k_send_cmd(dev, CMD_STOP);
writew(0, devpriv->io_addr + DPR_Int_Mask); writew(0, devpriv->io_addr + DPR_Int_Mask);
...@@ -560,7 +556,6 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -560,7 +556,6 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
unsigned int chan, range, aref; unsigned int chan, range, aref;
unsigned int divider; unsigned int divider;
unsigned int tscandiv; unsigned int tscandiv;
int ret;
unsigned int mode; unsigned int mode;
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
...@@ -595,7 +590,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -595,7 +590,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
writew(AI_FIFO_DEPTH / 2, devpriv->io_addr + DPR_Params(7)); writew(AI_FIFO_DEPTH / 2, devpriv->io_addr + DPR_Params(7));
writew(SUBS_AI, devpriv->io_addr + DPR_SubSys); writew(SUBS_AI, devpriv->io_addr + DPR_SubSys);
ret = dt3k_send_cmd(dev, CMD_CONFIG); dt3k_send_cmd(dev, CMD_CONFIG);
writew(DT3000_ADFULL | DT3000_ADSWERR | DT3000_ADHWERR, writew(DT3000_ADFULL | DT3000_ADSWERR | DT3000_ADHWERR,
devpriv->io_addr + DPR_Int_Mask); devpriv->io_addr + DPR_Int_Mask);
...@@ -603,7 +598,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -603,7 +598,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
debug_n_ints = 0; debug_n_ints = 0;
writew(SUBS_AI, devpriv->io_addr + DPR_SubSys); writew(SUBS_AI, devpriv->io_addr + DPR_SubSys);
ret = dt3k_send_cmd(dev, CMD_START); dt3k_send_cmd(dev, CMD_START);
return 0; return 0;
} }
......
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