staging: tidspbridge: dynamically allocate my_sym_buf in dload_symbols
Dynamically allocate my_sym_buf to silence the following warning:
drivers/staging/tidspbridge/dynload/cload.c:
In function 'dload_symbols':
drivers/staging/tidspbridge/dynload/cload.c:890:
warning: the frame size of 1040 bytes is larger than 1024 bytes
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: tidspbridge: dynamically allocate ibuf in dload_data
Dynamically allocate ibuf to silence the following warning:
drivers/staging/tidspbridge/dynload/cload.c:
In function 'dload_data':
drivers/staging/tidspbridge/dynload/cload.c:1337:
warning: the frame size of 1216 bytes is larger than 1024 bytes
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Due to its size, this function declares too many variables,
to split it a new structure has been declared to hold values
as they are read from the baseimage.
While at it, indentation was reduced by renaming variables
and reducing blocks of code with the following structure:
if (success) {
...
if (success)
...
}
This fixes the following warning:
drivers/staging/tidspbridge/core/io_sm.c:
In function 'bridge_io_on_loaded':
drivers/staging/tidspbridge/core/io_sm.c:777:
warning: the frame size of 1032 bytes is larger
than 1024 bytes
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
And fix the following warning for passing an incorrect
variable type.
../tiomap3430.c: In function 'user_va2_pa':
../tiomap3430.c:1555:
warning: passing argument 1 of 'pmd_offset' from
incompatible pointer type
arch/arm/include/asm/pgtable-2level.h:156:
note: expected 'struct pud_t *' but argument is of
type 'pmdval_t (*)[2]'
While at it, eliminate 'if' nesting to increase readability.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: line6: control.c eliminate strict_strtoul() in pod_set_param_int()
Exchange strict_strtoul() with kstrtou8() and make "value" a u8 instead of a
unsigned long. This is also needed for the changed
line6_pod_transmit_parameter().
Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jesper Juhl [Wed, 27 Jun 2012 20:02:19 +0000 (22:02 +0200)]
staging: vt6656: int.c: Use one space between variable type and name
The style of most kernel code is that there is 1 *space* between the
type of a variable and its name. This patch enforces that in
drivers/staging/vt6656/int.c .
Javier M. Mellid [Wed, 27 Jun 2012 12:10:15 +0000 (14:10 +0200)]
staging: sm7xxfb: erase hardcode cast between smtcfb_info and fb_info
This patch erases hardcode cast between smtcfb_info and fb_info in order
to get a more robust and less rigid smtcfb_info structure. fb_info
doesn't need to be the first field in smtcfb_info after this patch.
Tested with SM712.
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: s626: fix the number of dio channels
The first digital i/o subdevice has its n_chan set to S626_DIO_CHANNELS
which is defined as 48. This is actually the total number of channels
provided by all three digital i/o subdevices. Each subdevice only has
16 channels.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The 'devpriv' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable. Replace
the macro with a local variable where used.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Like most of the comedi drivers, this one appears to have been started
based on the skel driver. Cut-and-paste from that driver has resulted
in an unnecessarily complex boardinfo struct.
Remove everything from the boardinfo struct, except the 'name', and
just use the open coded values in the attach function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: dmm32at: use module_comedi_driver
Convert driver to use the module_comedi_driver() macro to remove
some of the boilerplate.
Move the comedi_driver variable to the end of the file to keep it
with the module_comedi_driver() macro. This also removes the need
for some of the forward declarations. While moving the variable:
1) strip out the unnecessary cut-and-paste skel driver comments
2) add whitespace to improve the readability
3) rename the variable from driver* to *driver
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The 'thisboard' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable. Replace
the macro with a local variable where used. Use the comedi_board()
helper to get the pointer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The pcmcia support code in this driver is cut-and-paste from the
dummy_cs.c driver of the Linux PCMCIA Card Services package. It
has code in it to stop the device during suspend but nothing in
the main comedi_driver uses it.
Remove the 'stop' variable from the pcmcia private data and all
the logic that deals with it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das08_cs: change driver registration order
As done with the other comedi driver types, register the
comedi_driver first then the pcmcia_driver. Also, make sure
the pcmcia_driver registration succeeds and unregister the
comedi_driver if it fails.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das08_cs: consolidate the init and exit functions
The register/unregister of the pcmcia driver is done in separate
functions that are called by the module_{init,exit} routines.
Simplify the code a bit by moving the register/unregister into
the module_{init,exit} routines.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das_08: absorb i8254_struct into the private data
The i8254_struct now only contains the iobase address used to
read/write the 8254 timer device. Move that variable into the
das08 private data struct and remove the i8254_struct.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das_08: remove the unneeded 8254 variables and defines
Now that the driver is using the 8253 helper functions, remove the
unused variables in the i8254_struct as well as the unused defines
for the 8254 register offsets.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das_08: remove the cached 8254 'mode'
The driver initially sets all the cached 'mode' values for the
8254 timers to (I8254_MODE0 | I8254_BINARY). It then sets the
timers to that 'mode'. Configuring the counters with the comedi
INSN_CONFIG_SET_COUNTER_MODE updates the 'mode' and then sets
the timers to the 'mode'. The cached value is never read or
used other than for storage.
Just remove the 'mode' usage as it serves no purpose.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: das_08: unwind the 8254 timer support
Refactor the 8254 timer support by removing the various functions
that handle the io and consolidating the logic into the initialize,
read, write, and config functions used by the driver.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add local variable for the io_addr, mask. and bits used in this
function so that the comments are not needed and the writel/readl
calls are a bit cleaner.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
For aesthetic reasons, reorder the boardinfo struct so that the
'name' pointer is first. Also, add some whitespace to the boardinfo
to improve readability.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_670x: fix dereference of an invalid pointer
The attach if this driver can fail before the subdevices are
allocated. If the attach fails the comedi core will call the
detach routine to allow the driver to do it's cleanup.
We need to make sure that the subdevice allocation was successful
before trying to dereference subdevice[0] to free the allocated
range table list.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_670x: change printk's to cleaned up dev_printk's
Convert all the prink's in this file to dev_prink's.
Change the INFO message in ni_670x_find_device into a dev_warn().
This message is only displayed if a matching device was not found.
A warning is more appropriate here than info.
Consolidate the attach messages into one dev_info() output after
the successful attach.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: ni_670x: remove thisboard and devpriv macros
The 'thisboard' and 'devpriv' macros rely on a local variable having
a specific name and yield pointers derived from that local variable.
Replace the macros with local variables where used. Use the
comedi_board() helper to get the 'thisboard' pointer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci6208: use the driver_name for the resource name
Use the dev->driver->driver_name for the resource name passed to
pci_request_regions(), by way of comedi_pci_enable(), instead of
the open coded string "adl_pci6208".
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci6208: fix the ao_readback variable size
The 'ao_readback' variable in the private data struct is used to
cache the last value written to the analog output DAC channels.
The PCI-6208 has 8 analog output channels but the variable only
allowed space to cache 2 values.
Since the PCI-6216 board could be supported by this driver and
it has 16 analog outputs, create a define for the maximum number
of channels and use that to set the size of 'ao_readback'.
For now, set the max to 8 to save space since the PCI-6216 is
not currently supported.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci6208: remove the bogus pci devices
Remove the commented out pci device entries in the MODULE_DEVICE_TABLE
as well as the associated boardinfo, which is also commented out. Add
some whitespace to the boardinfo to improve readability.
This driver should also support the pci-6216 card which has an
additional 8 analog outputs (16 total). But the device id needs
to be determined.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci6208: fix the digital i/o subdevice
The PCI-6208 board has 4 digital outputs and 4 digital inputs.
The support for the digital i/o subdevice was commented out and
the code was just cut-and-paste from the skel driver. Enable
the digital i/o subdevice by uncommenting the code and fixing
the insn_bits and insn_config functions.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Refactor pci6208_pci_setup() into the attach function. This
function simply enables the pci device and gets the PCI iobase
address used by the driver. There's no need for a separate
function to handle this.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The "local configuration register" stuff is not required. The
io base/range are only queried for use in a kernel message
that it just added noise. Similar with the io range for the
actual io base used by the driver.
Remove both printk's and all the unnecessary code.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Make the "find pci device" functions consistent in the comedi
drivers. Hopefully well be able to move it into the core...
Refactor the "find pci device" function to return a pointer to
the found struct pci_dev instead of an error code. Also, change
some of the tests to reduce the indent level of the code. Pass
the struct comedi_devconfig pointer to the function instead of
the bus/slot numbers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: adl_pci6208: remove thisboard and devpriv macros
The 'thisboard' and 'devpriv' macros rely on a local variable having
a specific name and yield pointers derived from that local variable.
Replace the macros with local variables where used. Use the
comedi_board() helper to get the 'thisboard' pointer.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As pointed out by Ian Abbott, the comedi INSN_WRITE instructions
are meant to iterate over, and write, all the data[] passed from
the comedi core. Modify dac08_write_insn() to work as intended.
Since doc08_write_insn() now returns the proper response to the
core, make the dac08_write() helper return void.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reported-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reverse the logic of the test against the cached value so that
the function only has one exit point.
Make the logic of the dac write a bit clearer by create a local
variable for the address used in the outw() calls and masking the
value to write and setting the enable bits before doing the outw()
calls. Add a comment just to make sure it's clear.
Also, add a comment about the 'return 1;'. This should be
insn->n which is the number of data parameters used to do the
dac08_write_insn() but the insn is not a parameter to this
function.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcidas: add whitespace to all the #define's
Add whitespace to all the #define's in the driver in order to
improve the readability. Fix all the comments that are, or
already were, > 80 characters.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
staging: comedi: cb_pcidas: change dac bit enums into defines
The 'bits' for the DAC_CSR register are currently defined as
enums. All the other registers use defines for the bit definitions.
Change the dac bit enums to defines to follow the other registers.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>