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

staging: comedi: me4000: convert printk's to dev_printk's

A lot of the messages produced by this driver are just noise and
need to be removed. For now just convert them all to dev_printk's.
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 81dd1811
...@@ -399,9 +399,7 @@ static int xilinx_download(struct comedi_device *dev) ...@@ -399,9 +399,7 @@ static int xilinx_download(struct comedi_device *dev)
/* Wait until /INIT pin is set */ /* Wait until /INIT pin is set */
udelay(20); udelay(20);
if (!(inl(info->plx_regbase + PLX_INTCSR) & 0x20)) { if (!(inl(info->plx_regbase + PLX_INTCSR) & 0x20)) {
printk(KERN_ERR dev_err(dev->class_dev, "Can't init Xilinx\n");
"comedi%d: me4000: xilinx_download(): "
"Can't init Xilinx\n", dev->minor);
return -EIO; return -EIO;
} }
...@@ -410,8 +408,8 @@ static int xilinx_download(struct comedi_device *dev) ...@@ -410,8 +408,8 @@ static int xilinx_download(struct comedi_device *dev)
value &= ~0x100; value &= ~0x100;
outl(value, info->plx_regbase + PLX_ICR); outl(value, info->plx_regbase + PLX_ICR);
if (FIRMWARE_NOT_AVAILABLE) { if (FIRMWARE_NOT_AVAILABLE) {
comedi_error(dev, "xilinx firmware unavailable " dev_err(dev->class_dev,
"due to licensing, aborting"); "xilinx firmware unavailable due to licensing, aborting");
return -EIO; return -EIO;
} else { } else {
/* Download Xilinx firmware */ /* Download Xilinx firmware */
...@@ -425,10 +423,9 @@ static int xilinx_download(struct comedi_device *dev) ...@@ -425,10 +423,9 @@ static int xilinx_download(struct comedi_device *dev)
/* Check if BUSY flag is low */ /* Check if BUSY flag is low */
if (inl(info->plx_regbase + PLX_ICR) & 0x20) { if (inl(info->plx_regbase + PLX_ICR) & 0x20) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: xilinx_download(): "
"Xilinx is still busy (idx = %d)\n", "Xilinx is still busy (idx = %d)\n",
dev->minor, idx); idx);
return -EIO; return -EIO;
} }
} }
...@@ -437,12 +434,8 @@ static int xilinx_download(struct comedi_device *dev) ...@@ -437,12 +434,8 @@ static int xilinx_download(struct comedi_device *dev)
/* If done flag is high download was successful */ /* If done flag is high download was successful */
if (inl(info->plx_regbase + PLX_ICR) & 0x4) { if (inl(info->plx_regbase + PLX_ICR) & 0x4) {
} else { } else {
printk(KERN_ERR dev_err(dev->class_dev, "DONE flag is not set\n");
"comedi%d: me4000: xilinx_download(): " dev_err(dev->class_dev, "Download not successful\n");
"DONE flag is not set\n", dev->minor);
printk(KERN_ERR
"comedi%d: me4000: xilinx_download(): "
"Download not successful\n", dev->minor);
return -EIO; return -EIO;
} }
...@@ -515,9 +508,8 @@ static int me4000_ai_insn_read(struct comedi_device *dev, ...@@ -515,9 +508,8 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
if (insn->n == 0) { if (insn->n == 0) {
return 0; return 0;
} else if (insn->n > 1) { } else if (insn->n > 1) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid instruction length %d\n",
"comedi%d: me4000: me4000_ai_insn_read(): " insn->n);
"Invalid instruction length %d\n", dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
...@@ -535,9 +527,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev, ...@@ -535,9 +527,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
entry |= ME4000_AI_LIST_RANGE_BIPOLAR_10; entry |= ME4000_AI_LIST_RANGE_BIPOLAR_10;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid range specified\n");
"comedi%d: me4000: me4000_ai_insn_read(): "
"Invalid range specified\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
...@@ -545,9 +535,8 @@ static int me4000_ai_insn_read(struct comedi_device *dev, ...@@ -545,9 +535,8 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
case AREF_GROUND: case AREF_GROUND:
case AREF_COMMON: case AREF_COMMON:
if (chan >= thisboard->ai_nchan) { if (chan >= thisboard->ai_nchan) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: me4000_ai_insn_read(): " "Analog input is not available\n");
"Analog input is not available\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
entry |= ME4000_AI_LIST_INPUT_SINGLE_ENDED | chan; entry |= ME4000_AI_LIST_INPUT_SINGLE_ENDED | chan;
...@@ -555,25 +544,20 @@ static int me4000_ai_insn_read(struct comedi_device *dev, ...@@ -555,25 +544,20 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
case AREF_DIFF: case AREF_DIFF:
if (rang == 0 || rang == 1) { if (rang == 0 || rang == 1) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: me4000_ai_insn_read(): " "Range must be bipolar when aref = diff\n");
"Range must be bipolar when aref = diff\n",
dev->minor);
return -EINVAL; return -EINVAL;
} }
if (chan >= thisboard->ai_diff_nchan) { if (chan >= thisboard->ai_diff_nchan) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: me4000_ai_insn_read(): " "Analog input is not available\n");
"Analog input is not available\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
entry |= ME4000_AI_LIST_INPUT_DIFFERENTIAL | chan; entry |= ME4000_AI_LIST_INPUT_DIFFERENTIAL | chan;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid aref specified\n");
"comedi%d: me4000: me4000_ai_insn_read(): "
"Invalid aref specified\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
...@@ -609,9 +593,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev, ...@@ -609,9 +593,7 @@ static int me4000_ai_insn_read(struct comedi_device *dev,
udelay(10); udelay(10);
if (!(inl(dev->iobase + ME4000_AI_STATUS_REG) & if (!(inl(dev->iobase + ME4000_AI_STATUS_REG) &
ME4000_AI_STATUS_BIT_EF_DATA)) { ME4000_AI_STATUS_BIT_EF_DATA)) {
printk(KERN_ERR dev_err(dev->class_dev, "Value not available after wait\n");
"comedi%d: me4000: me4000_ai_insn_read(): "
"Value not available after wait\n", dev->minor);
return -EIO; return -EIO;
} }
...@@ -647,25 +629,19 @@ static int ai_check_chanlist(struct comedi_device *dev, ...@@ -647,25 +629,19 @@ static int ai_check_chanlist(struct comedi_device *dev,
/* Check whether a channel list is available */ /* Check whether a channel list is available */
if (!cmd->chanlist_len) { if (!cmd->chanlist_len) {
printk(KERN_ERR dev_err(dev->class_dev, "No channel list available\n");
"comedi%d: me4000: ai_check_chanlist(): "
"No channel list available\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
/* Check the channel list size */ /* Check the channel list size */
if (cmd->chanlist_len > ME4000_AI_CHANNEL_LIST_COUNT) { if (cmd->chanlist_len > ME4000_AI_CHANNEL_LIST_COUNT) {
printk(KERN_ERR dev_err(dev->class_dev, "Channel list is to large\n");
"comedi%d: me4000: ai_check_chanlist(): "
"Channel list is to large\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
/* Check the pointer */ /* Check the pointer */
if (!cmd->chanlist) { if (!cmd->chanlist) {
printk(KERN_ERR dev_err(dev->class_dev, "NULL pointer to channel list\n");
"comedi%d: me4000: ai_check_chanlist(): "
"NULL pointer to channel list\n", dev->minor);
return -EFAULT; return -EFAULT;
} }
...@@ -673,10 +649,8 @@ static int ai_check_chanlist(struct comedi_device *dev, ...@@ -673,10 +649,8 @@ static int ai_check_chanlist(struct comedi_device *dev,
aref = CR_AREF(cmd->chanlist[0]); aref = CR_AREF(cmd->chanlist[0]);
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
if (CR_AREF(cmd->chanlist[i]) != aref) { if (CR_AREF(cmd->chanlist[i]) != aref) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: ai_check_chanlist(): " "Mode is not equal for all entries\n");
"Mode is not equal for all entries\n",
dev->minor);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -686,18 +660,16 @@ static int ai_check_chanlist(struct comedi_device *dev, ...@@ -686,18 +660,16 @@ static int ai_check_chanlist(struct comedi_device *dev,
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
if (CR_CHAN(cmd->chanlist[i]) >= if (CR_CHAN(cmd->chanlist[i]) >=
thisboard->ai_diff_nchan) { thisboard->ai_diff_nchan) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: ai_check_chanlist():" "Channel number to high\n");
" Channel number to high\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
} }
} else { } else {
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
if (CR_CHAN(cmd->chanlist[i]) >= thisboard->ai_nchan) { if (CR_CHAN(cmd->chanlist[i]) >= thisboard->ai_nchan) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: ai_check_chanlist(): " "Channel number to high\n");
"Channel number to high\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -708,11 +680,8 @@ static int ai_check_chanlist(struct comedi_device *dev, ...@@ -708,11 +680,8 @@ static int ai_check_chanlist(struct comedi_device *dev,
for (i = 0; i < cmd->chanlist_len; i++) { for (i = 0; i < cmd->chanlist_len; i++) {
if (CR_RANGE(cmd->chanlist[i]) != 1 && if (CR_RANGE(cmd->chanlist[i]) != 1 &&
CR_RANGE(cmd->chanlist[i]) != 2) { CR_RANGE(cmd->chanlist[i]) != 2) {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: ai_check_chanlist(): " "Bipolar is not selected in differential mode\n");
"Bipolar is not selected in "
"differential mode\n",
dev->minor);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -966,9 +935,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -966,9 +935,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
err++; err++;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start source\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start source\n", dev->minor);
cmd->start_src = TRIG_NOW; cmd->start_src = TRIG_NOW;
err++; err++;
} }
...@@ -982,9 +949,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -982,9 +949,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
err++; err++;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid scan begin source\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid scan begin source\n", dev->minor);
cmd->scan_begin_src = TRIG_FOLLOW; cmd->scan_begin_src = TRIG_FOLLOW;
err++; err++;
} }
...@@ -997,9 +962,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -997,9 +962,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
err++; err++;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid convert source\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid convert source\n", dev->minor);
cmd->convert_src = TRIG_TIMER; cmd->convert_src = TRIG_TIMER;
err++; err++;
} }
...@@ -1012,9 +975,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1012,9 +975,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
err++; err++;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid scan end source\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid scan end source\n", dev->minor);
cmd->scan_end_src = TRIG_NONE; cmd->scan_end_src = TRIG_NONE;
err++; err++;
} }
...@@ -1027,9 +988,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1027,9 +988,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
err++; err++;
break; break;
default: default:
printk(KERN_ERR dev_err(dev->class_dev, "Invalid stop source\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid stop source\n", dev->minor);
cmd->stop_src = TRIG_NONE; cmd->stop_src = TRIG_NONE;
err++; err++;
} }
...@@ -1058,9 +1017,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1058,9 +1017,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
cmd->scan_begin_src == TRIG_EXT && cmd->scan_begin_src == TRIG_EXT &&
cmd->convert_src == TRIG_EXT) { cmd->convert_src == TRIG_EXT) {
} else { } else {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start trigger combination\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start trigger combination\n", dev->minor);
cmd->start_src = TRIG_NOW; cmd->start_src = TRIG_NOW;
cmd->scan_begin_src = TRIG_FOLLOW; cmd->scan_begin_src = TRIG_FOLLOW;
cmd->convert_src = TRIG_TIMER; cmd->convert_src = TRIG_TIMER;
...@@ -1075,9 +1032,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1075,9 +1032,7 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
} else if (cmd->stop_src == TRIG_COUNT && } else if (cmd->stop_src == TRIG_COUNT &&
cmd->scan_end_src == TRIG_COUNT) { cmd->scan_end_src == TRIG_COUNT) {
} else { } else {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid stop trigger combination\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid stop trigger combination\n", dev->minor);
cmd->stop_src = TRIG_NONE; cmd->stop_src = TRIG_NONE;
cmd->scan_end_src = TRIG_NONE; cmd->scan_end_src = TRIG_NONE;
err++; err++;
...@@ -1089,30 +1044,22 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1089,30 +1044,22 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
* Stage 3. Check if arguments are generally valid. * Stage 3. Check if arguments are generally valid.
*/ */
if (cmd->chanlist_len < 1) { if (cmd->chanlist_len < 1) {
printk(KERN_ERR dev_err(dev->class_dev, "No channel list\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"No channel list\n", dev->minor);
cmd->chanlist_len = 1; cmd->chanlist_len = 1;
err++; err++;
} }
if (init_ticks < 66) { if (init_ticks < 66) {
printk(KERN_ERR dev_err(dev->class_dev, "Start arg to low\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Start arg to low\n", dev->minor);
cmd->start_arg = 2000; cmd->start_arg = 2000;
err++; err++;
} }
if (scan_ticks && scan_ticks < 67) { if (scan_ticks && scan_ticks < 67) {
printk(KERN_ERR dev_err(dev->class_dev, "Scan begin arg to low\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Scan begin arg to low\n", dev->minor);
cmd->scan_begin_arg = 2031; cmd->scan_begin_arg = 2031;
err++; err++;
} }
if (chan_ticks < 66) { if (chan_ticks < 66) {
printk(KERN_ERR dev_err(dev->class_dev, "Convert arg to low\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Convert arg to low\n", dev->minor);
cmd->convert_arg = 2000; cmd->convert_arg = 2000;
err++; err++;
} }
...@@ -1129,23 +1076,17 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1129,23 +1076,17 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
/* Check timer arguments */ /* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) { if (init_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start arg\n", dev->minor);
cmd->start_arg = 2000; /* 66 ticks at least */ cmd->start_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (chan_ticks < ME4000_AI_MIN_TICKS) { if (chan_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid convert arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid convert arg\n", dev->minor);
cmd->convert_arg = 2000; /* 66 ticks at least */ cmd->convert_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (scan_ticks <= cmd->chanlist_len * chan_ticks) { if (scan_ticks <= cmd->chanlist_len * chan_ticks) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid scan end arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid scan end arg\n", dev->minor);
/* At least one tick more */ /* At least one tick more */
cmd->scan_end_arg = 2000 * cmd->chanlist_len + 31; cmd->scan_end_arg = 2000 * cmd->chanlist_len + 31;
...@@ -1157,16 +1098,12 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1157,16 +1098,12 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
/* Check timer arguments */ /* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) { if (init_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start arg\n", dev->minor);
cmd->start_arg = 2000; /* 66 ticks at least */ cmd->start_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (chan_ticks < ME4000_AI_MIN_TICKS) { if (chan_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid convert arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid convert arg\n", dev->minor);
cmd->convert_arg = 2000; /* 66 ticks at least */ cmd->convert_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
...@@ -1176,23 +1113,17 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1176,23 +1113,17 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
/* Check timer arguments */ /* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) { if (init_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start arg\n", dev->minor);
cmd->start_arg = 2000; /* 66 ticks at least */ cmd->start_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (chan_ticks < ME4000_AI_MIN_TICKS) { if (chan_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid convert arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid convert arg\n", dev->minor);
cmd->convert_arg = 2000; /* 66 ticks at least */ cmd->convert_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (scan_ticks <= cmd->chanlist_len * chan_ticks) { if (scan_ticks <= cmd->chanlist_len * chan_ticks) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid scan end arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid scan end arg\n", dev->minor);
/* At least one tick more */ /* At least one tick more */
cmd->scan_end_arg = 2000 * cmd->chanlist_len + 31; cmd->scan_end_arg = 2000 * cmd->chanlist_len + 31;
...@@ -1204,16 +1135,12 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1204,16 +1135,12 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
/* Check timer arguments */ /* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) { if (init_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start arg\n", dev->minor);
cmd->start_arg = 2000; /* 66 ticks at least */ cmd->start_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (chan_ticks < ME4000_AI_MIN_TICKS) { if (chan_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid convert arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid convert arg\n", dev->minor);
cmd->convert_arg = 2000; /* 66 ticks at least */ cmd->convert_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
...@@ -1223,16 +1150,12 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1223,16 +1150,12 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
/* Check timer arguments */ /* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) { if (init_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start arg\n", dev->minor);
cmd->start_arg = 2000; /* 66 ticks at least */ cmd->start_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
if (chan_ticks < ME4000_AI_MIN_TICKS) { if (chan_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid convert arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid convert arg\n", dev->minor);
cmd->convert_arg = 2000; /* 66 ticks at least */ cmd->convert_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
...@@ -1242,27 +1165,21 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev, ...@@ -1242,27 +1165,21 @@ static int me4000_ai_do_cmd_test(struct comedi_device *dev,
/* Check timer arguments */ /* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) { if (init_ticks < ME4000_AI_MIN_TICKS) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid start arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid start arg\n", dev->minor);
cmd->start_arg = 2000; /* 66 ticks at least */ cmd->start_arg = 2000; /* 66 ticks at least */
err++; err++;
} }
} }
if (cmd->stop_src == TRIG_COUNT) { if (cmd->stop_src == TRIG_COUNT) {
if (cmd->stop_arg == 0) { if (cmd->stop_arg == 0) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid stop arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid stop arg\n", dev->minor);
cmd->stop_arg = 1; cmd->stop_arg = 1;
err++; err++;
} }
} }
if (cmd->scan_end_src == TRIG_COUNT) { if (cmd->scan_end_src == TRIG_COUNT) {
if (cmd->scan_end_arg == 0) { if (cmd->scan_end_arg == 0) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid scan end arg\n");
"comedi%d: me4000: me4000_ai_do_cmd_test(): "
"Invalid scan end arg\n", dev->minor);
cmd->scan_end_arg = 1; cmd->scan_end_arg = 1;
err++; err++;
} }
...@@ -1297,9 +1214,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1297,9 +1214,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
/* Check if irq number is right */ /* Check if irq number is right */
if (irq != dev->irq) { if (irq != dev->irq) {
printk(KERN_ERR dev_err(dev->class_dev, "Incorrect interrupt num: %d\n", irq);
"comedi%d: me4000: me4000_ai_isr(): "
"Incorrect interrupt num: %d\n", dev->minor, irq);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -1324,9 +1239,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1324,9 +1239,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
printk(KERN_ERR dev_err(dev->class_dev, "FIFO overflow\n");
"comedi%d: me4000: me4000_ai_isr(): "
"FIFO overflow\n", dev->minor);
} else if ((tmp & ME4000_AI_STATUS_BIT_FF_DATA) } else if ((tmp & ME4000_AI_STATUS_BIT_FF_DATA)
&& !(tmp & ME4000_AI_STATUS_BIT_HF_DATA) && !(tmp & ME4000_AI_STATUS_BIT_HF_DATA)
&& (tmp & ME4000_AI_STATUS_BIT_EF_DATA)) { && (tmp & ME4000_AI_STATUS_BIT_EF_DATA)) {
...@@ -1334,9 +1247,8 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1334,9 +1247,8 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
c = ME4000_AI_FIFO_COUNT / 2; c = ME4000_AI_FIFO_COUNT / 2;
} else { } else {
printk(KERN_ERR dev_err(dev->class_dev,
"comedi%d: me4000: me4000_ai_isr(): " "Can't determine state of fifo\n");
"Can't determine state of fifo\n", dev->minor);
c = 0; c = 0;
/* /*
...@@ -1350,9 +1262,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1350,9 +1262,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA; s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
printk(KERN_ERR dev_err(dev->class_dev, "Undefined FIFO state\n");
"comedi%d: me4000: me4000_ai_isr(): "
"Undefined FIFO state\n", dev->minor);
} }
for (i = 0; i < c; i++) { for (i = 0; i < c; i++) {
...@@ -1372,9 +1282,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1372,9 +1282,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
s->async->events |= COMEDI_CB_OVERFLOW; s->async->events |= COMEDI_CB_OVERFLOW;
printk(KERN_ERR dev_err(dev->class_dev, "Buffer overflow\n");
"comedi%d: me4000: me4000_ai_isr(): "
"Buffer overflow\n", dev->minor);
break; break;
} }
...@@ -1408,9 +1316,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id) ...@@ -1408,9 +1316,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
lval ^= 0x8000; lval ^= 0x8000;
if (!comedi_buf_put(s->async, lval)) { if (!comedi_buf_put(s->async, lval)) {
printk(KERN_ERR dev_err(dev->class_dev, "Buffer overflow\n");
"comedi%d: me4000: me4000_ai_isr(): "
"Buffer overflow\n", dev->minor);
s->async->events |= COMEDI_CB_OVERFLOW; s->async->events |= COMEDI_CB_OVERFLOW;
break; break;
} }
...@@ -1447,30 +1353,23 @@ static int me4000_ao_insn_write(struct comedi_device *dev, ...@@ -1447,30 +1353,23 @@ static int me4000_ao_insn_write(struct comedi_device *dev,
if (insn->n == 0) { if (insn->n == 0) {
return 0; return 0;
} else if (insn->n > 1) { } else if (insn->n > 1) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid instruction length %d\n",
"comedi%d: me4000: me4000_ao_insn_write(): " insn->n);
"Invalid instruction length %d\n", dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
if (chan >= thisboard->ao_nchan) { if (chan >= thisboard->ao_nchan) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid channel %d\n", insn->n);
"comedi%d: me4000: me4000_ao_insn_write(): "
"Invalid channel %d\n", dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
if (rang != 0) { if (rang != 0) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid range %d\n", insn->n);
"comedi%d: me4000: me4000_ao_insn_write(): "
"Invalid range %d\n", dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
if (aref != AREF_GROUND && aref != AREF_COMMON) { if (aref != AREF_GROUND && aref != AREF_COMMON) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid aref %d\n", insn->n);
"comedi%d: me4000: me4000_ao_insn_write(): "
"Invalid aref %d\n", dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
...@@ -1501,9 +1400,7 @@ static int me4000_ao_insn_read(struct comedi_device *dev, ...@@ -1501,9 +1400,7 @@ static int me4000_ao_insn_read(struct comedi_device *dev,
if (insn->n == 0) { if (insn->n == 0) {
return 0; return 0;
} else if (insn->n > 1) { } else if (insn->n > 1) {
printk dev_err(dev->class_dev, "Invalid instruction length\n");
("comedi%d: me4000: me4000_ao_insn_read(): "
"Invalid instruction length\n", dev->minor);
return -EINVAL; return -EINVAL;
} }
...@@ -1699,10 +1596,8 @@ static int me4000_cnt_insn_read(struct comedi_device *dev, ...@@ -1699,10 +1596,8 @@ static int me4000_cnt_insn_read(struct comedi_device *dev,
return 0; return 0;
if (insn->n > 1) { if (insn->n > 1) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid instruction length %d\n",
"comedi%d: me4000: me4000_cnt_insn_read(): " insn->n);
"Invalid instruction length %d\n",
dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
...@@ -1720,10 +1615,8 @@ static int me4000_cnt_insn_write(struct comedi_device *dev, ...@@ -1720,10 +1615,8 @@ static int me4000_cnt_insn_write(struct comedi_device *dev,
if (insn->n == 0) { if (insn->n == 0) {
return 0; return 0;
} else if (insn->n > 1) { } else if (insn->n > 1) {
printk(KERN_ERR dev_err(dev->class_dev, "Invalid instruction length %d\n",
"comedi%d: me4000: me4000_cnt_insn_write(): " insn->n);
"Invalid instruction length %d\n",
dev->minor, insn->n);
return -EINVAL; return -EINVAL;
} }
......
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