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

staging: comedi: ni_tio: fix ni_tio_set_gate_src() params/vars

As suggested by checkpatch.pl:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f79f218e
...@@ -891,16 +891,16 @@ static int ni_m_set_gate2(struct ni_gpct *counter, unsigned int gate_source) ...@@ -891,16 +891,16 @@ static int ni_m_set_gate2(struct ni_gpct *counter, unsigned int gate_source)
return 0; return 0;
} }
int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index, int ni_tio_set_gate_src(struct ni_gpct *counter,
unsigned int gate_source) unsigned int gate, unsigned int src)
{ {
struct ni_gpct_device *counter_dev = counter->counter_dev; struct ni_gpct_device *counter_dev = counter->counter_dev;
unsigned cidx = counter->counter_index; unsigned int cidx = counter->counter_index;
unsigned int chan = CR_CHAN(gate_source); unsigned int chan = CR_CHAN(src);
unsigned gate2_reg = NITIO_GATE2_REG(cidx); unsigned int gate2_reg = NITIO_GATE2_REG(cidx);
unsigned mode = 0; unsigned int mode = 0;
switch (gate_index) { switch (gate) {
case 0: case 0:
if (chan == NI_GPCT_DISABLED_GATE_SELECT) { if (chan == NI_GPCT_DISABLED_GATE_SELECT) {
ni_tio_set_bits(counter, NITIO_MODE_REG(cidx), ni_tio_set_bits(counter, NITIO_MODE_REG(cidx),
...@@ -908,9 +908,9 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index, ...@@ -908,9 +908,9 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index,
GI_GATING_DISABLED); GI_GATING_DISABLED);
return 0; return 0;
} }
if (gate_source & CR_INVERT) if (src & CR_INVERT)
mode |= GI_GATE_POL_INVERT; mode |= GI_GATE_POL_INVERT;
if (gate_source & CR_EDGE) if (src & CR_EDGE)
mode |= GI_RISING_EDGE_GATING; mode |= GI_RISING_EDGE_GATING;
else else
mode |= GI_LEVEL_GATING; mode |= GI_LEVEL_GATING;
...@@ -921,9 +921,9 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index, ...@@ -921,9 +921,9 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index,
case ni_gpct_variant_e_series: case ni_gpct_variant_e_series:
case ni_gpct_variant_m_series: case ni_gpct_variant_m_series:
default: default:
return ni_m_set_gate(counter, gate_source); return ni_m_set_gate(counter, src);
case ni_gpct_variant_660x: case ni_gpct_variant_660x:
return ni_660x_set_gate(counter, gate_source); return ni_660x_set_gate(counter, src);
} }
break; break;
case 1: case 1:
...@@ -936,15 +936,15 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index, ...@@ -936,15 +936,15 @@ int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index,
gate2_reg); gate2_reg);
return 0; return 0;
} }
if (gate_source & CR_INVERT) if (src & CR_INVERT)
counter_dev->regs[gate2_reg] |= GI_GATE2_POL_INVERT; counter_dev->regs[gate2_reg] |= GI_GATE2_POL_INVERT;
else else
counter_dev->regs[gate2_reg] &= ~GI_GATE2_POL_INVERT; counter_dev->regs[gate2_reg] &= ~GI_GATE2_POL_INVERT;
switch (counter_dev->variant) { switch (counter_dev->variant) {
case ni_gpct_variant_m_series: case ni_gpct_variant_m_series:
return ni_m_set_gate2(counter, gate_source); return ni_m_set_gate2(counter, src);
case ni_gpct_variant_660x: case ni_gpct_variant_660x:
return ni_660x_set_gate2(counter, gate_source); return ni_660x_set_gate2(counter, src);
default: default:
BUG(); BUG();
break; break;
......
...@@ -245,7 +245,6 @@ static inline unsigned ni_tio_get_soft_copy(const struct ni_gpct *counter, ...@@ -245,7 +245,6 @@ static inline unsigned ni_tio_get_soft_copy(const struct ni_gpct *counter,
} }
int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger); int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger);
int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index, int ni_tio_set_gate_src(struct ni_gpct *, unsigned int gate, unsigned int src);
unsigned int gate_source);
#endif /* _COMEDI_NI_TIO_INTERNAL_H */ #endif /* _COMEDI_NI_TIO_INTERNAL_H */
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