Aya Mahfouz [Tue, 3 Mar 2015 14:27:37 +0000 (16:27 +0200)]
staging: iio: meter: add check on return variables
adds checks on variables that are used to return values. If
the value is less than zero, this indicates that an error
occurred and hence a message is printed through dev_err.
Checks are made on negative values only since spi_* functions
return negative error codes.
The functions were found using the following script but the
aforementioned modification was what was carried out in the end:
@@
identifier len,f;
@@
-int len;
... when != len
when strict
-len =
+return
f(...);
-return len;
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Reviewed-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes a if condition which has a semicolon
after it. As the conditional check is redundant, the comment
before it is also changed. The following
coccinelle script was used to detect the pattern of a
semicolon after if.
@r1@
position p;
@@
if (...);@p
@script:python@
p0 << r1.p;
@@
// Emacs org-mode output
cocci.print_main("", p0)
cocci.print_secs("", p0)
Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tina Johnson [Mon, 2 Mar 2015 18:10:26 +0000 (23:40 +0530)]
staging: lustre: lustre: libcfs: Replaced printk() with pr_err() and pr_cont()
The following checkpatch warning was fixed:
Prefer [subsystem eg: netdev]_err([subsystem]dev
with the help of Coccinelle. pr_cont() was used to replace those printk
statements which followed a printk that did not end with a '\n'. The following
semantic patch was used to replace printk() with pr_err():
@a@
expression e;
@@
printk(e,...);
@script:python b@
e << a.e;
y;
@@
import re
match = re.match('KERN_ERR ', e);
if (match == None):
cocci.include_match(False)
else:
m = re.sub('KERN_ERR ', '', e)
coccinelle.y = m;
@c@
expression a.e;
identifier b.y;
@@
- printk(e,
+ pr_err(y,
...);
Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haneen Mohammed [Mon, 2 Mar 2015 18:37:38 +0000 (21:37 +0300)]
Staging: emxx_udc: Replace custom printk macro ERR with dev_err or pr_err
This patch removes the use of custom printk macros ERR and replace it
with dev_err, or pr_err in the following cases:
- if no appropriate struct device *dev field where found for dev_err.
- or dev could be null eg. "dev_err(udc->dev" not possible inside "if
(udc == null)"
Issue addressed by checkpatch.pl.
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Haneen Mohammed [Mon, 2 Mar 2015 17:01:42 +0000 (20:01 +0300)]
Staging: emxx_udc: Fix do not add new typedefs and remove volatile
This patch fixes the following checkpatch.pl warnings:"do not add new
typedefs" and "Use of volatile is usually wrong".
Remove typedefs keyword and rename identifiers appropriately.
Remove volatile from union usb_regs_access
Update related files.
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Oleg Drokin [Tue, 3 Mar 2015 07:39:36 +0000 (02:39 -0500)]
staging/lustre/llite: Fix obd name after c&p error
commit 95745e9b1de2 ("staging: lustre: Use kasprintf.") introduced
a copy and paste error causing two different obd types to be assigned
same content causing lustre to fail on mount with a warning from procfs
followed by a bizzare error about OST not having enough MDS
capabilities.
This patch unbreaks Lustre client again.
Signed-off-by: Oleg Drokin <green@linuxhacker.ru> CC: Navya Sri Nizamkari <navyasri.tech@gmail.com> CC: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
That's for a PLX PCI 9050/9052 PCI interface chip with custom subvendor
and subdevice ID. The "%String6208%" macro expands to "ADLINK PCI-6208"
in the INF file.
Add a corresponding entry to this driver module's PCI device table.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 27 Feb 2015 15:07:36 +0000 (15:07 +0000)]
staging: comedi: adl_pci6208: remove multiple board type support
This driver module now only supports a single board type, so remove the
infrastructure for describing multiple board types. The comedi
"auto_attach" handler, `pci6208_auto_attach()` doesn't need to set the
comedi device's `board_name` or `board_ptr` members. The former is
automatically pointed to the comedi driver's `driver_name` by the core
comedi module, and the latter is not used anywhere else. The AO
subdevice's `n_chans` member can be set to 16 without looking it up in
the single element of `pci6208_boards[]`. There is no need to pass a
board index from the PCI device table to the "auto_attach" handler.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 27 Feb 2015 15:07:35 +0000 (15:07 +0000)]
staging: comedi: adl_pci6208: combine PCI-6208 and PCI-6216 support
This module's PCI device table has separate PCI device IDs for PCI-6208
and PCI-6216, but in reality, both boards and their cPCI and PCIe
variants seem to have the same PCI device ID: 0x6208. The PCI subdevice
ID doesn't seem to help either.
It shouldn't do any harm to claim 16 AO channels for all devices
supported by this driver. The original PCI-6216 is just a PCI-6208 with
a daughter board providing the extra DACs. The data is clocked out to
the DACs serially with no acknowledgment. I assume this would still
happen when the DACs for the upper 8 channels are missing. Therefore,
change the driver to support a single board type with 16 AO channels,
and remove the suspicious PCI device ID for the PCI-6216.
Evidence about lack of a separate PCI device ID for PCI-6216 follows....
1. Jesus Vasquez reports the following lspci output for a PCIe-6216 on
his Ubuntu 12.04 system:
lspci -n -vvv
07:00.0 1180: 144a:6208 (rev 02)
Subsystem: 144a:6208
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Region 0: Memory at f6000000 (32-bit, non-prefetchable)
[size=128]
Region 1: I/O ports at c100 [size=128]
Region 2: I/O ports at c000 [size=256]
Kernel driver in use: adl_pci6208
Kernel modules: adl_pci6208
That system's "adl_pci6208" module only has the single PCI device ID for
the PCI-6208, but works for his PCIe-6216 except that it only supports 8
analog output channels instead of 16.
2. ADLINK's binary Linux module "pci6208.ko" (there is no separate
module for the PCI-6216) has a single alias:
alias: pci:v0000144Ad00006208sv*sd*bc*sc*i*
3. The MS Windows drivers include this set of hardware IDs for the
PCI-6208 series, with nothing more specific for the PCI-6216 (they are
all tied to the same name "ADLINK PCI-6208" and there is no mention of
PCI-6216):
staging: comedi: cb_pcimdas: add 8254 timer (pacer) support
The hardware has an 8254 timer/counter. Channe; 0 is available as a
generic counter/timer with the clock, gate, and output signals all
availabe on the main 37 pin connector. Channels 1 and 2 are used for
the pacer.
Add support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcimdas: tidy up cb_pcimdas_auto_attach()
For aesthetics, add some whitespace to the subdevice init.
Remove the unnecessary comments as well as the initialization of the
analog input subdevice 'len_chanlist'. That member is only used by
subdevices that support async commands.
For aesthetics, rename the analog input subdevice (*insn_read) function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcimdas: provide analog output range table
The analog output range is not programmable. The DAC ranges are
jumper-settable on the board. For aesthetics, provide a range table
for the user with all possible ranges.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcimdas: support analog input programmable ranges
The hardware uses a switch on the board to select if the analog inputs
are bipolar or uinipolar. The gain is programmable to allow the following
input ranges:
Gain Bipolar Unipolar
0 +/-10V 0 to 10V
1 +/-5V 0 to 5V
2 +/-2.5V 0 to 2.5V
3 +/-1.25V 0 to 1.25V
Add the necessary code to the driver to allow the user to select the
desired range.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcimdas: fix analog input channel configuration
The hardware uses a switch on the board to set the number of analog
input channels to either 16 single-ended or 8 differential channels.
Currently the switch setting is checked for every (*insn_read) operation
to validate the channel number.
Check the switch setting during the driver attach and initialize the
subdevice accordingly. This allows the core to handle the validation.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_labpc_common: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
The hardware actually has two 8254 devices. Timer B0 is the master for timed
conversions, timer B1 sets the scan pacing, and tmer A0 sets the conversion
pacing.
For the conversion, dev->pacer is used for the "B" timers and a new private
data member, dev->counter, is used for the "A" timers. All the divisor values
are stored in the dev->pacer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: amplc_dio200_common: remove 'spinlock' from struct dio200_subdev_8254
Currently this driver uses a spinlock in the 8254 subdevice (*insn_read), (*insn_write),
and (*insn_config) functions. The comedi core checks if the subdevice is 'busy', in
parse_insn(), before any of the subdevice functions are attempted.
Remove the unnecessary spinlock.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The 'counter_number' in these functions is the comedi channel number from the
chanspec. The comedi core validates the chanspec before calling the driver
functions. Remove the unnecessary checks.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci9118: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das16: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: me4000: convert driver to use the comedi_8254 module
Some of the hardware supported by this driver include an 8254 timer. For
aesthetics, convert it to use the comedi_8254 module to provide support for
the 8254 timer.
This also fixes the (*insn_read) and (*insn_write) to work like the comedi
API expects. Currently they only read or write a single value.
It also fixes the (*insn_config). Currently the driver is attempting to
handle the configuration instructions GPCT_RESET and GPCT_SET_OPERATION.
These are just arbitrary valuse and are not real comedi configuration_ids.
They actually coorespond to:
The number of parameters for the instructions is validated by the comedi
core in check_insn_config_length(). GPCT_RESET happens to work (insn->n == 1)
but GPCT_SET_OPERATION would fail. The INSN_CONFIG_ANALOG_TRIG expects
insn->n == 5 but GPCT_SET_OPERATION in this driver expects insn->n == 2.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adv_pci_dio: convert driver to use the comedi_8254 module
Some of the hardware supported by this driver includes an 8254 timer. For
aesthetics, convert it to use the comedi_8254 module to provide support for
the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The boardinfo for the 8254 timer is overly complex. The 8254 timer always has
3 channels and the 'regs' and 'specflags' members of diosubd_data are not
used. The only necessary information is the base 'addr' offset to the 8254
registers.
Replace the 's8254' member with an unsigned long 'timer_regbase'. Use that
to determine if the board has an 8254 timer during the attach of the driver.
Save the 'timer_regbase' in the subdevice 'private' pointer to use in the
subdevice functions.
For aesthetics, absorb pci_dio_add_8254() into the driver attach function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Only two of the boards supported by this driver have an 8254 counter/timer.
Both of these boards have a single 8254 device. Currently the counter
subdevice functions are coded to support multiple 8254 devices. This is
unnecessary and just complicates the code.
Simplfy the subdevice functions to work for a single 8254 counter/timer and
refactor the driver (*attach) accordingly.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das1800: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Tidy up the (*do_cmdtest) validation of the timer arguments.
Absorb the converted das1800_setup_counters() code into the (*do_cmd).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das6402: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Remove the unnecessary programming of timer 0. The private data 'count'
value is never set by the driver and the timer is reset to MODE0 when
the timers are initialized during the attach of the driver.
Remove the unnecessart convert_src check in the (*do_cmdtest). The only
valid convert_src is TRIG_TIMER.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_at_a2150: convert driver to use the comedi_8254 module
The hardware supported by this driver includes an 8254 timer. For aesthetics,
convert it to use the comedi_8254 module to provide support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_at_ao: convert driver to use the comedi_8254 module
The hardware supported by this driver includes an 8254 timer. This timer is
not currently used, other than setting counters 1 and 2 to MODE4 to ensure
that the outputs are high.
For aesthetics, convert it to use the comedi_8254 module to provide support
for the 8254 timer. This will make it easier to add features later.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das08: convert driver to use the comedi_8254 module
Some of the hardware supported by this driver include an 8254 timer that is
exposed to the user as a comedi_subdevice. Convert it to use the comedi_8254
module to provide support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: amplc_pci230: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adv_pci1710: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data acquisition. It also provides a comedi_subdevice to allow the user
to use channel 0 of the 8254 timer. Currently the subdevice support does not
work correctly due to and (*insn_config) that does not follow the comedi API.
Convert it to use the comedi_8254 module to provide support for the 8254 timer
and proper support for the subdevice.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_das16_cs: convert driver to use the comedi_8254 module
The hardware supported by this drive has an 8254 timer. Currently this driver
does not use the timer functions.
For aesthetics, use the comedi_8254 module to provide support for the 8254
timer. This will ensure that the counters are all reset and make it easier
to add functionality later.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das16m1: convert driver to use the comedi_8254 module
This driver uses two 8254 timers. One to generate the analog input pacer clock and
one to count the number of samples. Convert it to use the comedi_8254 module to
provide support for the 8254 timers.
Use the comedi_device 'pacer' member for the 8254 timer used for analog input. This
data is freed automatically by the core during the detach of the driver.
Store the data for the 8254 timer used to count samples in the private data. This
data needs to be freed by the driver when it is detached.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das800: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data acquisition. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcidas: convert driver to use the comedi_8254 module
This driver uses two 8254 timers to generate the pacer clocks. One for analog
input acquisition and one for analog output data conversion. Convert it to use
the comedi_8254 module to provide support for the 8254 timers.
Use the comedi_device 'pacer' member for the 8254 timer used for analog input.
This data is freed automatically by the core during the detach of the driver.
Store the data for the 8254 timer used for analog output in the private data.
This data needs to be freed by the driver when it is detached.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: amplc_pci224: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
output data conversion. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci9111: convert driver to use the comedi_8254 module
This driver uses an 8254 timer to generate the pacer clock used for analog
input data acquisition. Convert it to use the comedi_8254 module to provide
support for the 8254 timer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>