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

staging: comedi: ni_mio_common: remove use of comedi_error()

The comedi_error() function is just a wrapper around dev_err() that adds
the dev->driver->driver_name prefix to the message and a terminating
new-line character. The addition of the driver_name is just added noise
and some of the users of comedi_error() add unnecessary additional new-line
characters.

Use dev_err() directly instead of comedi_error() to avoid any confusion
and so that all the comedi generated kernel messages have the same format.
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 74e9607b
...@@ -771,8 +771,8 @@ static int ni_request_ai_mite_channel(struct comedi_device *dev) ...@@ -771,8 +771,8 @@ static int ni_request_ai_mite_channel(struct comedi_device *dev)
mite_request_channel(devpriv->mite, devpriv->ai_mite_ring); mite_request_channel(devpriv->mite, devpriv->ai_mite_ring);
if (devpriv->ai_mite_chan == NULL) { if (devpriv->ai_mite_chan == NULL) {
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
comedi_error(dev, dev_err(dev->class_dev,
"failed to reserve mite dma channel for analog input."); "failed to reserve mite dma channel for analog input\n");
return -EBUSY; return -EBUSY;
} }
devpriv->ai_mite_chan->dir = COMEDI_INPUT; devpriv->ai_mite_chan->dir = COMEDI_INPUT;
...@@ -792,8 +792,8 @@ static int ni_request_ao_mite_channel(struct comedi_device *dev) ...@@ -792,8 +792,8 @@ static int ni_request_ao_mite_channel(struct comedi_device *dev)
mite_request_channel(devpriv->mite, devpriv->ao_mite_ring); mite_request_channel(devpriv->mite, devpriv->ao_mite_ring);
if (devpriv->ao_mite_chan == NULL) { if (devpriv->ao_mite_chan == NULL) {
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
comedi_error(dev, dev_err(dev->class_dev,
"failed to reserve mite dma channel for analog outut."); "failed to reserve mite dma channel for analog outut\n");
return -EBUSY; return -EBUSY;
} }
devpriv->ao_mite_chan->dir = COMEDI_OUTPUT; devpriv->ao_mite_chan->dir = COMEDI_OUTPUT;
...@@ -818,8 +818,8 @@ static int ni_request_gpct_mite_channel(struct comedi_device *dev, ...@@ -818,8 +818,8 @@ static int ni_request_gpct_mite_channel(struct comedi_device *dev,
devpriv->gpct_mite_ring[gpct_index]); devpriv->gpct_mite_ring[gpct_index]);
if (mite_chan == NULL) { if (mite_chan == NULL) {
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
comedi_error(dev, dev_err(dev->class_dev,
"failed to reserve mite dma channel for counter."); "failed to reserve mite dma channel for counter\n");
return -EBUSY; return -EBUSY;
} }
mite_chan->dir = direction; mite_chan->dir = direction;
...@@ -844,8 +844,8 @@ static int ni_request_cdo_mite_channel(struct comedi_device *dev) ...@@ -844,8 +844,8 @@ static int ni_request_cdo_mite_channel(struct comedi_device *dev)
mite_request_channel(devpriv->mite, devpriv->cdo_mite_ring); mite_request_channel(devpriv->mite, devpriv->cdo_mite_ring);
if (devpriv->cdo_mite_chan == NULL) { if (devpriv->cdo_mite_chan == NULL) {
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
comedi_error(dev, dev_err(dev->class_dev,
"failed to reserve mite dma channel for correlated digital outut."); "failed to reserve mite dma channel for correlated digital output\n");
return -EBUSY; return -EBUSY;
} }
devpriv->cdo_mite_chan->dir = COMEDI_OUTPUT; devpriv->cdo_mite_chan->dir = COMEDI_OUTPUT;
...@@ -971,7 +971,7 @@ static void ni_clear_ai_fifo(struct comedi_device *dev) ...@@ -971,7 +971,7 @@ static void ni_clear_ai_fifo(struct comedi_device *dev)
udelay(1); udelay(1);
} }
if (i == timeout) if (i == timeout)
comedi_error(dev, "FIFO flush timeout."); dev_err(dev->class_dev, "FIFO flush timeout\n");
} else { } else {
ni_stc_writew(dev, 1, ADC_FIFO_Clear); ni_stc_writew(dev, 1, ADC_FIFO_Clear);
if (devpriv->is_625x) { if (devpriv->is_625x) {
...@@ -1126,7 +1126,7 @@ static int ni_ao_wait_for_dma_load(struct comedi_device *dev) ...@@ -1126,7 +1126,7 @@ static int ni_ao_wait_for_dma_load(struct comedi_device *dev)
udelay(10); udelay(10);
} }
if (i == timeout) { if (i == timeout) {
comedi_error(dev, "timed out waiting for dma load"); dev_err(dev->class_dev, "timed out waiting for dma load\n");
return -EPIPE; return -EPIPE;
} }
return 0; return 0;
...@@ -1291,7 +1291,8 @@ static void ni_ai_fifo_read(struct comedi_device *dev, ...@@ -1291,7 +1291,8 @@ static void ni_ai_fifo_read(struct comedi_device *dev,
} else { } else {
if (n > sizeof(devpriv->ai_fifo_buffer) / if (n > sizeof(devpriv->ai_fifo_buffer) /
sizeof(devpriv->ai_fifo_buffer[0])) { sizeof(devpriv->ai_fifo_buffer[0])) {
comedi_error(dev, "bug! ai_fifo_buffer too small"); dev_err(dev->class_dev,
"bug! ai_fifo_buffer too small\n");
async->events |= COMEDI_CB_ERROR; async->events |= COMEDI_CB_ERROR;
return; return;
} }
...@@ -2438,7 +2439,7 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -2438,7 +2439,7 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
int interrupt_a_enable = 0; int interrupt_a_enable = 0;
if (dev->irq == 0) { if (dev->irq == 0) {
comedi_error(dev, "cannot run command without an irq"); dev_err(dev->class_dev, "cannot run command without an irq\n");
return -EIO; return -EIO;
} }
ni_clear_ai_fifo(dev); ni_clear_ai_fifo(dev);
...@@ -3088,8 +3089,8 @@ static int ni_ao_inttrig(struct comedi_device *dev, ...@@ -3088,8 +3089,8 @@ static int ni_ao_inttrig(struct comedi_device *dev,
break; break;
} }
if (i == timeout) { if (i == timeout) {
comedi_error(dev, dev_err(dev->class_dev,
"timed out waiting for AO_TMRDACWRs_In_Progress_St to clear"); "timed out waiting for AO_TMRDACWRs_In_Progress_St to clear\n");
return -EIO; return -EIO;
} }
/* /*
...@@ -3121,7 +3122,7 @@ static int ni_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -3121,7 +3122,7 @@ static int ni_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
unsigned trigvar; unsigned trigvar;
if (dev->irq == 0) { if (dev->irq == 0) {
comedi_error(dev, "cannot run command without an irq"); dev_err(dev->class_dev, "cannot run command without an irq\n");
return -EIO; return -EIO;
} }
...@@ -3611,7 +3612,7 @@ static int ni_cdo_inttrig(struct comedi_device *dev, ...@@ -3611,7 +3612,7 @@ static int ni_cdo_inttrig(struct comedi_device *dev,
mite_prep_dma(devpriv->cdo_mite_chan, 32, 32); mite_prep_dma(devpriv->cdo_mite_chan, 32, 32);
mite_dma_arm(devpriv->cdo_mite_chan); mite_dma_arm(devpriv->cdo_mite_chan);
} else { } else {
comedi_error(dev, "BUG: no cdo mite channel?"); dev_err(dev->class_dev, "BUG: no cdo mite channel?\n");
retval = -EIO; retval = -EIO;
} }
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
...@@ -3629,7 +3630,7 @@ static int ni_cdo_inttrig(struct comedi_device *dev, ...@@ -3629,7 +3630,7 @@ static int ni_cdo_inttrig(struct comedi_device *dev,
udelay(10); udelay(10);
} }
if (i == timeout) { if (i == timeout) {
comedi_error(dev, "dma failed to fill cdo fifo!"); dev_err(dev->class_dev, "dma failed to fill cdo fifo!\n");
s->cancel(dev, s); s->cancel(dev, s);
return -EIO; return -EIO;
} }
...@@ -3664,8 +3665,8 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -3664,8 +3665,8 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
ni_writel(dev, CDO_SW_Update_Bit, M_Offset_CDIO_Command); ni_writel(dev, CDO_SW_Update_Bit, M_Offset_CDIO_Command);
ni_writel(dev, s->io_bits, M_Offset_CDO_Mask_Enable); ni_writel(dev, s->io_bits, M_Offset_CDO_Mask_Enable);
} else { } else {
comedi_error(dev, dev_err(dev->class_dev,
"attempted to run digital output command with no lines configured as outputs"); "attempted to run digital output command with no lines configured as outputs\n");
return -EIO; return -EIO;
} }
retval = ni_request_cdo_mite_channel(dev); retval = ni_request_cdo_mite_channel(dev);
...@@ -4769,7 +4770,8 @@ static void cs5529_command(struct comedi_device *dev, unsigned short value) ...@@ -4769,7 +4770,8 @@ static void cs5529_command(struct comedi_device *dev, unsigned short value)
} }
/* printk("looped %i times writing command to cs5529\n", i); */ /* printk("looped %i times writing command to cs5529\n", i); */
if (i == timeout) if (i == timeout)
comedi_error(dev, "possible problem - never saw adc go busy?"); dev_err(dev->class_dev,
"possible problem - never saw adc go busy?\n");
} }
static int cs5529_do_conversion(struct comedi_device *dev, static int cs5529_do_conversion(struct comedi_device *dev,
...@@ -4781,8 +4783,8 @@ static int cs5529_do_conversion(struct comedi_device *dev, ...@@ -4781,8 +4783,8 @@ static int cs5529_do_conversion(struct comedi_device *dev,
cs5529_command(dev, CSCMD_COMMAND | CSCMD_SINGLE_CONVERSION); cs5529_command(dev, CSCMD_COMMAND | CSCMD_SINGLE_CONVERSION);
retval = cs5529_wait_for_idle(dev); retval = cs5529_wait_for_idle(dev);
if (retval) { if (retval) {
comedi_error(dev, dev_err(dev->class_dev,
"timeout or signal in cs5529_do_conversion()"); "timeout or signal in cs5529_do_conversion()\n");
return -ETIME; return -ETIME;
} }
status = ni_ao_win_inw(dev, CAL_ADC_Status_67xx); status = ni_ao_win_inw(dev, CAL_ADC_Status_67xx);
...@@ -4841,7 +4843,8 @@ static void cs5529_config_write(struct comedi_device *dev, unsigned int value, ...@@ -4841,7 +4843,8 @@ static void cs5529_config_write(struct comedi_device *dev, unsigned int value,
reg_select_bits &= CSCMD_REGISTER_SELECT_MASK; reg_select_bits &= CSCMD_REGISTER_SELECT_MASK;
cs5529_command(dev, CSCMD_COMMAND | reg_select_bits); cs5529_command(dev, CSCMD_COMMAND | reg_select_bits);
if (cs5529_wait_for_idle(dev)) if (cs5529_wait_for_idle(dev))
comedi_error(dev, "time or signal in cs5529_config_write()"); dev_err(dev->class_dev,
"timeout or signal in %s\n", __func__);
} }
static int init_cs5529(struct comedi_device *dev) static int init_cs5529(struct comedi_device *dev)
...@@ -4861,7 +4864,8 @@ static int init_cs5529(struct comedi_device *dev) ...@@ -4861,7 +4864,8 @@ static int init_cs5529(struct comedi_device *dev)
cs5529_config_write(dev, config_bits | CSCFG_SELF_CAL_OFFSET, cs5529_config_write(dev, config_bits | CSCFG_SELF_CAL_OFFSET,
CSCMD_CONFIG_REGISTER); CSCMD_CONFIG_REGISTER);
if (cs5529_wait_for_idle(dev)) if (cs5529_wait_for_idle(dev))
comedi_error(dev, "timeout or signal in init_cs5529()\n"); dev_err(dev->class_dev,
"timeout or signal in %s\n", __func__);
#endif #endif
return 0; return 0;
} }
...@@ -5264,8 +5268,8 @@ static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -5264,8 +5268,8 @@ static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
retval = ni_request_gpct_mite_channel(dev, counter->counter_index, retval = ni_request_gpct_mite_channel(dev, counter->counter_index,
COMEDI_INPUT); COMEDI_INPUT);
if (retval) { if (retval) {
comedi_error(dev, dev_err(dev->class_dev,
"no dma channel available for use by counter"); "no dma channel available for use by counter\n");
return retval; return retval;
} }
ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL); ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
......
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