iio: ad5064: Move bus write callbacks to #if protected sections
Move the SPI and I2C specific write callbacks to the respective
"#if IS_ENABLED(CONFIG_SPI_MASTER)" and "#if IS_ENABLED(CONFIG_I2C)"
protected sections of the code.
This fixes the following warning which occurs if CONFIG_I2C is not set:
drivers/iio/dac/ad5064.c: In function ‘ad5064_i2c_write’:
drivers/iio/dac/ad5064.c:132: error: implicit declaration of function ‘i2c_master_send’
And the follwing warning which occurs when CONFIG_SPI_MASTER is not set:
drivers/iio/dac/ad5064.c:137: warning: ‘ad5064_spi_write’ defined but not used
Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
It is possible that on one of the error paths we are going to try to free
'rxbuf', even though it has not been allocated yet, which cause the following
warning:
drivers/staging/iio/adc/max1363_ring.c: In function 'max1363_trigger_handler':
drivers/staging/iio/adc/max1363_ring.c:87:7: warning: 'rxbuf' may be used
uninitialized in this function
staging:iio:adis16400: Do not return error code in the interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:adis16260: Do not return error code in the interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:accel:adis16xxx: Do not return error code in the interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:lis3l02dq: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:max1363: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad7887: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad7476: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad799x: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:dummy driver: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:adt7310: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio:ad7298: Do not return error code in interrupt handler
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The driver assumes that in 13bit mode the 16bit value has
to be shifted to the right by 3 bits. This is not true, in
both 16bit and 13bit mode the MSB is at the same position.
Currently the driver returns a temperature of 194 degrees
Celsius in 13bit mode and 24 degrees Celsius in 16bit mode.
Fix this by using the same algorithm for 16bit and 13bit
mode and by just masking out the lower three bits in 13bit
mode.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The dev_attr list is initialized in __iio_add_event_config_attrs which
is called only when indio_dev->channels is true. Nevertheless the list
is used unconditionally later in iio_device_register_eventset which
results in a NULL pointer exception. To fix this unconditionally
initialize the list in iio_device_register_eventset.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
staging:iio: Request threaded-only IRQs with IRQF_ONESHOT
Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests") threaded
IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise
the request will fail. This patch adds the IRQF_ONESHOT to IIO drivers where it
is missing.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
iio: iio_buffer_register: Use correct channel when calculating masklength
The channel set assigned to the iio device is not necessarily the same has the
channel set passed to iio_buffer_register. So to avoid possible complications
always work with the channel set pass to iio_buffer_register and ignore the
channel set assigned to the iio device.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Andy Shevchenko [Fri, 6 Jul 2012 15:28:17 +0000 (18:28 +0300)]
staging: vt6656: use %pM for the BSSID
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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>