Commit d0ba1e38 authored by Conrad Meyer's avatar Conrad Meyer Committed by Greg Kroah-Hartman

Staging: comedi: Fix some raw printks with dev_warn()

Brought to you with the help of sed and manual clean-up after.

  $ sed -i -e 's|printk("\\n|dev_warn(dev->hw_dev,\n\t"|' \
    addi-data/hwdrv_apci1500.c

Since all of these printk()s were for invalid API inputs and most of
them returned -EINVAL, I fixed the rest of them to return -EINVAL as
well.
Signed-off-by: default avatarConrad Meyer <cse.cem@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 56b1fcfd
...@@ -259,7 +259,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -259,7 +259,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
i_MaxChannel = 6; i_MaxChannel = 6;
} /* if(data[0]==2) */ } /* if(data[0]==2) */
else { else {
printk("\nThe specified port event does not exist\n"); dev_warn(dev->hw_dev,
"The specified port event does not exist\n");
return -EINVAL; return -EINVAL;
} /* else if(data[0]==2) */ } /* else if(data[0]==2) */
} /* else if (data[0] == 1) */ } /* else if (data[0] == 1) */
...@@ -274,7 +275,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -274,7 +275,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
data[1] = APCI1500_OR_PRIORITY; data[1] = APCI1500_OR_PRIORITY;
break; break;
default: default:
printk("\nThe specified interrupt logic does not exist\n"); dev_warn(dev->hw_dev,
"The specified interrupt logic does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[1]); */ } /* switch(data[1]); */
...@@ -318,7 +320,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -318,7 +320,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
case 5: case 5:
break; break;
default: default:
printk("\nThe option indicated in the event mask does not exist\n"); dev_warn(dev->hw_dev,
"The option indicated in the event mask does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(i_EventMask) */ } /* switch(i_EventMask) */
} /* for (i_Count = i_MaxChannel; i_Count >0;i_Count --) */ } /* for (i_Count = i_MaxChannel; i_Count >0;i_Count --) */
...@@ -338,10 +341,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -338,10 +341,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
if (data[1] == APCI1500_OR_PRIORITY if (data[1] == APCI1500_OR_PRIORITY
&& i_PatternTransition != 0) { && i_PatternTransition != 0) {
/********************************************/ dev_warn(dev->hw_dev,
/* Transition error on an OR PRIORITY logic */ "Transition error on an OR PRIORITY logic\n");
/********************************************/
printk("\nTransition error on an OR PRIORITY logic\n");
return -EINVAL; return -EINVAL;
} /* if (data[1]== APCI1500_OR_PRIORITY && i_PatternTransition != 0) */ } /* if (data[1]== APCI1500_OR_PRIORITY && i_PatternTransition != 0) */
...@@ -360,10 +361,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -360,10 +361,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
} /* for (i_Count = 0; i_Count < 8; i_Count++) */ } /* for (i_Count = 0; i_Count < 8; i_Count++) */
if (i_PatternTransitionCount > 1) { if (i_PatternTransitionCount > 1) {
/****************************************/ dev_warn(dev->hw_dev,
/* Transition error on an AND logic */ "Transition error on an AND logic\n");
/****************************************/
printk("\n Transition error on an AND logic\n");
return -EINVAL; return -EINVAL;
} /* if (i_PatternTransitionCount > 1) */ } /* if (i_PatternTransitionCount > 1) */
} /* if (data[1]== APCI1500_AND) */ } /* if (data[1]== APCI1500_AND) */
...@@ -457,7 +456,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -457,7 +456,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
} /* if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) */ } /* if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) */
else { else {
printk("\nThe choice for interrupt logic does not exist\n"); dev_warn(dev->hw_dev,
"The choice for interrupt logic does not exist\n");
return -EINVAL; return -EINVAL;
} /* else }// if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) */ } /* else }// if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) */
} /* if (data[0]== 1) */ } /* if (data[0]== 1) */
...@@ -585,7 +585,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev, ...@@ -585,7 +585,8 @@ static int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if (data[1] == APCI1500_OR) */ } /* if (data[1] == APCI1500_OR) */
else { else {
printk("\nThe choice for interrupt logic does not exist\n"); dev_warn(dev->hw_dev,
"The choice for interrupt logic does not exist\n");
return -EINVAL; return -EINVAL;
} /* elseif (data[1] == APCI1500_OR) */ } /* elseif (data[1] == APCI1500_OR) */
} /* if(data[0]==2) */ } /* if(data[0]==2) */
...@@ -691,7 +692,8 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev, ...@@ -691,7 +692,8 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev,
} /* if(i_Event1Status==1) */ } /* if(i_Event1Status==1) */
else { else {
printk("\nEvent 1 not initialised\n"); dev_warn(dev->hw_dev,
"Event 1 not initialised\n");
return -EINVAL; return -EINVAL;
} /* else if(i_Event1Status==1) */ } /* else if(i_Event1Status==1) */
} /* if (data[1]==1) */ } /* if (data[1]==1) */
...@@ -742,13 +744,15 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev, ...@@ -742,13 +744,15 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev,
i_Event2InterruptStatus = 1; i_Event2InterruptStatus = 1;
} /* if(i_Event2Status==1) */ } /* if(i_Event2Status==1) */
else { else {
printk("\nEvent 2 not initialised\n"); dev_warn(dev->hw_dev,
"Event 2 not initialised\n");
return -EINVAL; return -EINVAL;
} /* else if(i_Event2Status==1) */ } /* else if(i_Event2Status==1) */
} /* if(data[1]==2) */ } /* if(data[1]==2) */
} /* if (data[1] == 1 || data[0] == 2) */ } /* if (data[1] == 1 || data[0] == 2) */
else { else {
printk("\nThe port parameter is in error\n"); dev_warn(dev->hw_dev,
"The port parameter is in error\n");
return -EINVAL; return -EINVAL;
} /* else if (data[1] == 1 || data[0] == 2) */ } /* else if (data[1] == 1 || data[0] == 2) */
...@@ -803,7 +807,8 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev, ...@@ -803,7 +807,8 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev,
i_Event1InterruptStatus = 0; i_Event1InterruptStatus = 0;
} /* if(i_Event1Status==1) */ } /* if(i_Event1Status==1) */
else { else {
printk("\nEvent 1 not initialised\n"); dev_warn(dev->hw_dev,
"Event 1 not initialised\n");
return -EINVAL; return -EINVAL;
} /* else if(i_Event1Status==1) */ } /* else if(i_Event1Status==1) */
} /* if (data[1]==1) */ } /* if (data[1]==1) */
...@@ -846,19 +851,22 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev, ...@@ -846,19 +851,22 @@ static int i_APCI1500_StartStopInputEvent(struct comedi_device *dev,
i_Event2InterruptStatus = 0; i_Event2InterruptStatus = 0;
} /* if(i_Event2Status==1) */ } /* if(i_Event2Status==1) */
else { else {
printk("\nEvent 2 not initialised\n"); dev_warn(dev->hw_dev,
"Event 2 not initialised\n");
return -EINVAL; return -EINVAL;
} /* else if(i_Event2Status==1) */ } /* else if(i_Event2Status==1) */
} /* if(data[1]==2) */ } /* if(data[1]==2) */
} /* if (data[1] == 1 || data[1] == 2) */ } /* if (data[1] == 1 || data[1] == 2) */
else { else {
printk("\nThe port parameter is in error\n"); dev_warn(dev->hw_dev,
"The port parameter is in error\n");
return -EINVAL; return -EINVAL;
} /* else if (data[1] == 1 || data[1] == 2) */ } /* else if (data[1] == 1 || data[1] == 2) */
break; break;
default: default:
printk("\nThe option of START/STOP logic does not exist\n"); dev_warn(dev->hw_dev,
"The option of START/STOP logic does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[0]) */ } /* switch(data[0]) */
...@@ -1164,7 +1172,9 @@ static int i_APCI1500_WriteDigitalOutput(struct comedi_device *dev, ...@@ -1164,7 +1172,9 @@ static int i_APCI1500_WriteDigitalOutput(struct comedi_device *dev,
APCI1500_DIGITAL_OP); APCI1500_DIGITAL_OP);
} /* if(data[1]==1) */ } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); dev_warn(dev->hw_dev,
"Specified channel not supported\n");
return -EINVAL;
} /* else if(data[1]==1) */ } /* else if(data[1]==1) */
} /* elseif(data[1]==0) */ } /* elseif(data[1]==0) */
} /* if(data[3]==0) */ } /* if(data[3]==0) */
...@@ -1241,12 +1251,15 @@ static int i_APCI1500_WriteDigitalOutput(struct comedi_device *dev, ...@@ -1241,12 +1251,15 @@ static int i_APCI1500_WriteDigitalOutput(struct comedi_device *dev,
APCI1500_DIGITAL_OP); APCI1500_DIGITAL_OP);
} /* if(data[1]==1) */ } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); dev_warn(dev->hw_dev,
"Specified channel not supported\n");
return -EINVAL;
} /* else if(data[1]==1) */ } /* else if(data[1]==1) */
} /* elseif(data[1]==0) */ } /* elseif(data[1]==0) */
} /* if(data[3]==1); */ } /* if(data[3]==1); */
else { else {
printk("\nSpecified functionality does not exist\n"); dev_warn(dev->hw_dev,
"Specified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} /* if else data[3]==1) */ } /* if else data[3]==1) */
} /* if else data[3]==0) */ } /* if else data[3]==0) */
...@@ -1318,7 +1331,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1318,7 +1331,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
} /* if(data[0]==0||data[0]==1||data[0]==2) */ } /* if(data[0]==0||data[0]==1||data[0]==2) */
else { else {
if (data[0] != 3) { if (data[0] != 3) {
printk("\nThe option for input clock selection does not exist\n"); dev_warn(dev->hw_dev,
"The option for input clock selection does not exist\n");
return -EINVAL; return -EINVAL;
} /* if(data[0]!=3) */ } /* if(data[0]!=3) */
} /* elseif(data[0]==0||data[0]==1||data[0]==2) */ } /* elseif(data[0]==0||data[0]==1||data[0]==2) */
...@@ -1334,7 +1348,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1334,7 +1348,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[2] = APCI1500_TIMER; data[2] = APCI1500_TIMER;
break; break;
default: default:
printk("\nThis choice is not a timer nor a counter\n"); dev_warn(dev->hw_dev,
"This choice is not a timer nor a counter\n");
return -EINVAL; return -EINVAL;
} /* switch(data[2]) */ } /* switch(data[2]) */
...@@ -1347,7 +1362,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1347,7 +1362,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[4] = APCI1500_SINGLE; data[4] = APCI1500_SINGLE;
break; break;
default: default:
printk("\nThis option for single/continuous mode does not exist\n"); dev_warn(dev->hw_dev,
"This option for single/continuous mode does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[4]) */ } /* switch(data[4]) */
...@@ -1474,12 +1490,14 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1474,12 +1490,14 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */ } /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
else { else {
printk("\nError in selection of interrupt enable or disable\n"); dev_warn(dev->hw_dev,
"Error in selection of interrupt enable or disable\n");
return -EINVAL; return -EINVAL;
} /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */ } /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
} /* if ((data[3]>= 0) && (data[3] <= 65535)) */ } /* if ((data[3]>= 0) && (data[3] <= 65535)) */
else { else {
printk("\nError in selection of reload value\n"); dev_warn(dev->hw_dev,
"Error in selection of reload value\n");
return -EINVAL; return -EINVAL;
} /* else if ((data[3]>= 0) && (data[3] <= 65535)) */ } /* else if ((data[3]>= 0) && (data[3] <= 65535)) */
i_TimerCounterWatchdogInterrupt = data[7]; i_TimerCounterWatchdogInterrupt = data[7];
...@@ -1495,7 +1513,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1495,7 +1513,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[2] = APCI1500_TIMER; data[2] = APCI1500_TIMER;
break; break;
default: default:
printk("\nThis choice is not a timer nor a counter\n"); dev_warn(dev->hw_dev,
"This choice is not a timer nor a counter\n");
return -EINVAL; return -EINVAL;
} /* switch(data[2]) */ } /* switch(data[2]) */
...@@ -1508,7 +1527,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1508,7 +1527,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[4] = APCI1500_SINGLE; data[4] = APCI1500_SINGLE;
break; break;
default: default:
printk("\nThis option for single/continuous mode does not exist\n"); dev_warn(dev->hw_dev,
"This option for single/continuous mode does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[4]) */ } /* switch(data[4]) */
...@@ -1521,7 +1541,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1521,7 +1541,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[5] = APCI1500_HARDWARE_TRIGGER; data[5] = APCI1500_HARDWARE_TRIGGER;
break; break;
default: default:
printk("\nThis choice for software or hardware trigger does not exist\n"); dev_warn(dev->hw_dev,
"This choice for software or hardware trigger does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[5]) */ } /* switch(data[5]) */
...@@ -1534,7 +1555,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1534,7 +1555,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[6] = APCI1500_HARDWARE_GATE; data[6] = APCI1500_HARDWARE_GATE;
break; break;
default: default:
printk("\nThis choice for software or hardware gate does not exist\n"); dev_warn(dev->hw_dev,
"This choice for software or hardware gate does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[6]) */ } /* switch(data[6]) */
...@@ -1662,12 +1684,14 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1662,12 +1684,14 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */ } /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
else { else {
printk("\nError in selection of interrupt enable or disable\n"); dev_warn(dev->hw_dev,
"Error in selection of interrupt enable or disable\n");
return -EINVAL; return -EINVAL;
} /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */ } /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
} /* if ((data[3]>= 0) && (data[3] <= 65535)) */ } /* if ((data[3]>= 0) && (data[3] <= 65535)) */
else { else {
printk("\nError in selection of reload value\n"); dev_warn(dev->hw_dev,
"Error in selection of reload value\n");
return -EINVAL; return -EINVAL;
} /* else if ((data[3]>= 0) && (data[3] <= 65535)) */ } /* else if ((data[3]>= 0) && (data[3] <= 65535)) */
i_TimerCounterWatchdogInterrupt = data[7]; i_TimerCounterWatchdogInterrupt = data[7];
...@@ -1683,7 +1707,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1683,7 +1707,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[2] = APCI1500_WATCHDOG; data[2] = APCI1500_WATCHDOG;
break; break;
default: default:
printk("\nThis choice is not a watchdog nor a counter\n"); dev_warn(dev->hw_dev,
"This choice is not a watchdog nor a counter\n");
return -EINVAL; return -EINVAL;
} /* switch(data[2]) */ } /* switch(data[2]) */
...@@ -1696,7 +1721,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1696,7 +1721,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[4] = APCI1500_SINGLE; data[4] = APCI1500_SINGLE;
break; break;
default: default:
printk("\nThis option for single/continuous mode does not exist\n"); dev_warn(dev->hw_dev,
"This option for single/continuous mode does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[4]) */ } /* switch(data[4]) */
...@@ -1709,7 +1735,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1709,7 +1735,8 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
data[6] = APCI1500_HARDWARE_GATE; data[6] = APCI1500_HARDWARE_GATE;
break; break;
default: default:
printk("\nThis choice for software or hardware gate does not exist\n"); dev_warn(dev->hw_dev,
"This choice for software or hardware gate does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[6]) */ } /* switch(data[6]) */
...@@ -1857,12 +1884,14 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1857,12 +1884,14 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
} /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */ } /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
else { else {
printk("\nError in selection of interrupt enable or disable\n"); dev_warn(dev->hw_dev,
"Error in selection of interrupt enable or disable\n");
return -EINVAL; return -EINVAL;
} /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */ } /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
} /* if ((data[3]>= 0) && (data[3] <= 65535)) */ } /* if ((data[3]>= 0) && (data[3] <= 65535)) */
else { else {
printk("\nError in selection of reload value\n"); dev_warn(dev->hw_dev,
"Error in selection of reload value\n");
return -EINVAL; return -EINVAL;
} /* else if ((data[3]>= 0) && (data[3] <= 65535)) */ } /* else if ((data[3]>= 0) && (data[3] <= 65535)) */
i_TimerCounterWatchdogInterrupt = data[7]; i_TimerCounterWatchdogInterrupt = data[7];
...@@ -1870,7 +1899,9 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev, ...@@ -1870,7 +1899,9 @@ static int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device *dev,
break; break;
default: default:
printk("\nThe specified counter\timer option does not exist\n"); dev_warn(dev->hw_dev,
"The specified counter/timer option does not exist\n");
return -EINVAL;
} /* switch(data[1]) */ } /* switch(data[1]) */
i_CounterLogic = data[2]; i_CounterLogic = data[2];
return insn->n; return insn->n;
...@@ -1937,7 +1968,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -1937,7 +1968,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_TimerCounter1Init==1) */ } /* if( i_TimerCounter1Init==1) */
else { else {
printk("\nCounter/Timer1 not configured\n"); dev_warn(dev->hw_dev,
"Counter/Timer1 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -1988,13 +2020,15 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -1988,13 +2020,15 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_TimerCounter1Init==1) */ } /* if( i_TimerCounter1Init==1) */
else { else {
printk("\nCounter/Timer1 not configured\n"); dev_warn(dev->hw_dev,
"Counter/Timer1 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
default: default:
printk("\nThe specified option for start/stop/trigger does not exist\n"); dev_warn(dev->hw_dev,
"The specified option for start/stop/trigger does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[1]) */ } /* switch(data[1]) */
break; break;
...@@ -2024,7 +2058,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -2024,7 +2058,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_TimerCounter2Init==1) */ } /* if( i_TimerCounter2Init==1) */
else { else {
printk("\nCounter/Timer2 not configured\n"); dev_warn(dev->hw_dev,
"Counter/Timer2 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -2074,12 +2109,14 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -2074,12 +2109,14 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_TimerCounter2Init==1) */ } /* if( i_TimerCounter2Init==1) */
else { else {
printk("\nCounter/Timer2 not configured\n"); dev_warn(dev->hw_dev,
"Counter/Timer2 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
default: default:
printk("\nThe specified option for start/stop/trigger does not exist\n"); dev_warn(dev->hw_dev,
"The specified option for start/stop/trigger does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[1]) */ } /* switch(data[1]) */
break; break;
...@@ -2110,7 +2147,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -2110,7 +2147,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
} /* if( i_WatchdogCounter3init==1) */ } /* if( i_WatchdogCounter3init==1) */
else { else {
printk("\nWatchdog/Counter3 not configured\n"); dev_warn(dev->hw_dev,
"Watchdog/Counter3 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -2163,7 +2201,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -2163,7 +2201,8 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_WatchdogCounter3Init==1) */ } /* if( i_WatchdogCounter3Init==1) */
else { else {
printk("\nCounter3 not configured\n"); dev_warn(dev->hw_dev,
"Counter3 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -2182,22 +2221,26 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev, ...@@ -2182,22 +2221,26 @@ static int i_apci1500_timer_watchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_WatchdogCounter3Init==1) */ } /* if( i_WatchdogCounter3Init==1) */
else { else {
printk("\nWatchdog 3 not configured\n"); dev_warn(dev->hw_dev,
"Watchdog 3 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
default: default:
printk("\nWrong choice of watchdog/counter3\n"); dev_warn(dev->hw_dev,
"Wrong choice of watchdog/counter3\n");
return -EINVAL; return -EINVAL;
} /* switch(data[2]) */ } /* switch(data[2]) */
break; break;
default: default:
printk("\nThe specified option for start/stop/trigger does not exist\n"); dev_warn(dev->hw_dev,
"The specified option for start/stop/trigger does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[1]) */ } /* switch(data[1]) */
break; break;
default: default:
printk("\nThe specified choice for counter/watchdog/timer does not exist\n"); dev_warn(dev->hw_dev,
"The specified choice for counter/watchdog/timer does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[0]) */ } /* switch(data[0]) */
return insn->n; return insn->n;
...@@ -2283,7 +2326,8 @@ static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev, ...@@ -2283,7 +2326,8 @@ static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_TimerCounter1Init==1) */ } /* if( i_TimerCounter1Init==1) */
else { else {
printk("\nTimer/Counter1 not configured\n"); dev_warn(dev->hw_dev,
"Timer/Counter1 not configured\n");
return -EINVAL; return -EINVAL;
} /* elseif( i_TimerCounter1Init==1) */ } /* elseif( i_TimerCounter1Init==1) */
break; break;
...@@ -2334,7 +2378,8 @@ static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev, ...@@ -2334,7 +2378,8 @@ static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_TimerCounter2Init==1) */ } /* if( i_TimerCounter2Init==1) */
else { else {
printk("\nTimer/Counter2 not configured\n"); dev_warn(dev->hw_dev,
"Timer/Counter2 not configured\n");
return -EINVAL; return -EINVAL;
} /* elseif( i_TimerCounter2Init==1) */ } /* elseif( i_TimerCounter2Init==1) */
break; break;
...@@ -2385,12 +2430,14 @@ static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev, ...@@ -2385,12 +2430,14 @@ static int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device *dev,
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} /* if( i_WatchdogCounter3Init==1) */ } /* if( i_WatchdogCounter3Init==1) */
else { else {
printk("\nWatchdogCounter3 not configured\n"); dev_warn(dev->hw_dev,
"WatchdogCounter3 not configured\n");
return -EINVAL; return -EINVAL;
} /* elseif( i_WatchdogCounter3Init==1) */ } /* elseif( i_WatchdogCounter3Init==1) */
break; break;
default: default:
printk("\nThe choice of timer/counter/watchdog does not exist\n"); dev_warn(dev->hw_dev,
"The choice of timer/counter/watchdog does not exist\n");
return -EINVAL; return -EINVAL;
} /* switch(data[0]) */ } /* switch(data[0]) */
...@@ -2472,7 +2519,8 @@ static int i_APCI1500_ConfigureInterrupt(struct comedi_device *dev, ...@@ -2472,7 +2519,8 @@ static int i_APCI1500_ConfigureInterrupt(struct comedi_device *dev,
i_Constant = 0x00; i_Constant = 0x00;
} /* if{data[0]==0) */ } /* if{data[0]==0) */
else { else {
printk("\nThe parameter passed to driver is in error for enabling the voltage interrupt\n"); dev_warn(dev->hw_dev,
"The parameter passed to driver is in error for enabling the voltage interrupt\n");
return -EINVAL; return -EINVAL;
} /* else if(data[0]==0) */ } /* else if(data[0]==0) */
} /* elseif(data[0]==1) */ } /* elseif(data[0]==1) */
...@@ -2730,7 +2778,6 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2730,7 +2778,6 @@ static void v_APCI1500_Interrupt(int irq, void *d)
outb(i_RegValue, outb(i_RegValue,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
printk("\n\n\n");
/****************/ /****************/
/* Reads port B */ /* Reads port B */
/****************/ /****************/
...@@ -2857,7 +2904,8 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2857,7 +2904,8 @@ static void v_APCI1500_Interrupt(int irq, void *d)
outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER);
} /* if ((ui_InterruptStatus & 0x800000) == 0x800000) */ } /* if ((ui_InterruptStatus & 0x800000) == 0x800000) */
else { else {
printk("\nInterrupt from unknown source\n"); dev_warn(dev->hw_dev,
"Interrupt from unknown source\n");
} /* else if ((ui_InterruptStatus & 0x800000) == 0x800000) */ } /* else if ((ui_InterruptStatus & 0x800000) == 0x800000) */
return; return;
......
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