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

staging: comedi: usbduxsigma: tidy up chanToInterval()

Rename the function to have namespace associated with the driver.
Rename the CamelCase parameter 'nChannels' to avoid the checkpatch.pl
warning.

Tidy up the function a bit.
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 7333d50b
...@@ -502,16 +502,13 @@ static int usbduxsigma_submit_urbs(struct comedi_device *dev, ...@@ -502,16 +502,13 @@ static int usbduxsigma_submit_urbs(struct comedi_device *dev,
return 0; return 0;
} }
static int chanToInterval(int nChannels) static int usbduxsigma_chans_to_interval(int num_chan)
{ {
if (nChannels <= 2) if (num_chan <= 2)
/* 4kHz */ return 2; /* 4kHz */
return 2; if (num_chan <= 8)
if (nChannels <= 8) return 4; /* 2kHz */
/* 2kHz */ return 8; /* 1kHz */
return 4;
/* 1kHz */
return 8;
} }
static int usbduxsigma_ai_cmdtest(struct comedi_device *dev, static int usbduxsigma_ai_cmdtest(struct comedi_device *dev,
...@@ -520,7 +517,7 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev, ...@@ -520,7 +517,7 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev,
{ {
struct usbduxsigma_private *devpriv = dev->private; struct usbduxsigma_private *devpriv = dev->private;
int high_speed = devpriv->high_speed; int high_speed = devpriv->high_speed;
int interval = chanToInterval(cmd->chanlist_len); int interval = usbduxsigma_chans_to_interval(cmd->chanlist_len);
int err = 0; int err = 0;
/* Step 1 : check if triggers are trivially valid */ /* Step 1 : check if triggers are trivially valid */
......
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