summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-09-22staging:iio:ade7754: Do not return a error in remove functionLars-Peter Clausen
In the Linux device driver model the remove callback is not allowed to fail and the device will be removed regardless of the return value of the remove callback. So if we abort in the remove function and do not free all resources we will create a resource leak. Also all kinds of undefined behaviour are expected to happen since the IIO device is still there while its parent is already gone. The error which the driver tries to handle in the remove function is non-critical, so we can just ignore it and continue to free all resources and remove the IIO device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22staging:iio:ade7753: Do not return a error in remove functionLars-Peter Clausen
In the Linux device driver model the remove callback is not allowed to fail and the device will be removed regardless of the return value of the remove callback. So if we abort in the remove function and do not free all resources we will create a resource leak. Also all kinds of undefined behaviour are expected to happen since the IIO device is still there while its parent is already gone. The error which the driver tries to handle in the remove function is non-critical, so we can just ignore it and continue to free all resources and remove the IIO device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22staging:iio:adis16400: Do not return a error in remove functionLars-Peter Clausen
In the Linux device driver model the remove callback is not allowed to fail and the device will be removed regardless of the return value of the remove callback. So if we abort in the remove function and do not free all resources we will create a resource leak. Also all kinds of undefined behaviour are expected to happen since the IIO device is still there while its parent is already gone. The error which the driver tries to handle in the remove function is non-critical, so we can just ignore it and continue to free all resources and remove the IIO device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22staging:iio:adis16200: Do not return a error in remove functionLars-Peter Clausen
In the Linux device driver model the remove callback is not allowed to fail and the device will be removed regardless of the return value of the remove callback. So if we abort in the remove function and do not free all resources we will create a resource leak. Also all kinds of undefined behaviour are expected to happen since the IIO device is still there while its parent is already gone. The error which the driver tries to handle in the remove function is non-critical, so we can just ignore it and continue to free all resources and remove the IIO device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22iio: inkern: clean up error return codeKim, Milo
When the IIO consumer tries to get specific IIO channel, few error cases can be happened. (a) Memory allocation failure (b) No matched ADC channel error (c) Invalid input arguments This patch enables cleaning up error handling in case of (a) and (b). In error handling code, (a): the reference count of the IIO device should be decreased. (b): the allocated memory should be freed with restoring the reference count. Therefore iio_deivce_put() is called in both cases. This can be handled in the last error statement. Additionally, integer variable is used for stating each error case explicitly. Then, the error returns as ERR_PTR() with this value. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22iio: inkern: put the IIO device when it fails to allocate memoryKim, Milo
The reference count of the IIO device is increased if the IIO map has matched consumer name. After then, it tries to allocate the iio_channel which is used by the consumer. If it fails to allocate memory, the reference count should be decreased. This patch enables restoring the reference count of the IIO device. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22iio: dac/ad5755: signedness bug in ad5755_setup_pdata()Dan Carpenter
We need "ret" to be signed for the error handling to work correctly. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22iio: hid-sensors: Prevent crash during hot-unplugSrinivas Pandruvada
When hid sensor hub is unplugged, there is a crash in iio_device_unregister_trigger_consumer. In a typical IIO driver when remove is called, it will unregister and free trigger and then it will call iio_device_free. The function iio_trigger_free() will free the allocated memory for trigger. If this trigger was assigned to iio_dev->trig, then it should be set to NULL. Othewise when iio_device_free() is called later, it finally calls iio_device_unregsister_trigger(), which checks for if (indio_dev->trig) iio_trigger_put(indio_dev->trig); If indio_dev->trig is not set to NULL, it calls iio_trigger_put on a bad pointer causing crash. This scenerio can happen in any driver, which is storing trigger pointer in iio_dev structure and following current procedure during remove. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-18HID: sensors: remove some unneeded checksDan Carpenter
"report_id" is unsigned so it's never less than zero. These checks can be removed without any problem. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-18HID: sensors: use GFP_ATOMIC under spinlockDan Carpenter
We're holding a spinlock here so we can't call kmalloc() with GFP_KERNEL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-18HID: sensors: fix up for mfd_add_devices() API changeStephen Rothwell
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-18Staging: remove CONFIG_EXPERIMENTAL dependanciesGreg Kroah-Hartman
As discussed at the kernel summit this year, CONFIG_EXPERIMENTAL means nothing, so let's get rid of it. Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-18Staging: ced1401: fix copy_from/to_user warning messagesGreg Kroah-Hartman
Properly check the return value of copy_from/to_user() and handle any errors that might happen. This removes a bunch of compiler warnings. Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Cc: Greg P. Smith <greg@ced.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-18Staging ced1401: cleanup coding style issues.Greg Kroah-Hartman
A basic Lindent run on the .c files, clean up the .h file by hand. Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Cc: Greg P. Smith <greg@ced.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-18Staging: ced1401: add driver to the buildGreg Kroah-Hartman
This adds the ced1401 driver to the build system. Yes, there are a lot of warning messages, but it does compile, so it should be good to get going. Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Cc: Greg P. Smith <greg@ced.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-18Staging: ced1401: add TODO fileGreg Kroah-Hartman
This adds a first cut of a TODO file to get this driver out of the staging directory. Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Cc: Greg P. Smith <greg@ced.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-18Staging: ced1401: usb1401: fix build errors.Greg Kroah-Hartman
This fixes up the usb1401.c file to remove the usage of err() (which is gone), and the two-argument kmap_atomic() call, and the compat_ioctl pointer warning. The code now builds properly, there are lots of warnings still, but it's a start. Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Cc: Greg P. Smith <greg@ced.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-18Staging: add ced1401 USB driverAlois Schlögl
This was imported from the http://pub.ist.ac.at/~schloegl/src/ced1401/.git git repo at the request of Alois. The driver originally came from Cambridge Electronic Design Ltd and was authored by Greg P Smith and others, but Alois did the maintance work to get it into a semi-building state and pushed to get it into the main kernel tree here. Cc: Alois Schlögl <alois.schloegl@ist.ac.at> Cc: Greg P. Smith <greg@ced.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: comedi: jr3_pci: quiet "Using plain interger as NULL pointer" noiseH Hartley Sweeten
Quiet some sparse warnings about: warning: Using plain integer as NULL 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>
2012-09-17staging: comedi: pcmuio: pointers should be cleared with NULLH Hartley Sweeten
Pointer variables should be cleared with NULL on 0. This quiets some sparse warnings about: warning: Using plain integer as NULL 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>
2012-09-17staging: comedi: pcmmio: remove kernel messages about IRQH Hartley Sweeten
These messages are just added noise. They also cause some sparse warnings due to MAX_ASICS evaluating as 1. This causes the local variable 'irq' to be 'unsigned int irq[1]', which makes the 'irq[1]' access invalid. Just remove the messages. 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>
2012-09-17staging: comedi: mite: local symbols should not be exportedH Hartley Sweeten
The function mite_fifo_size() is only referenced in this file. Make it static. 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>
2012-09-17staging: comedi: ni_mio_cs: local symbols should not be exportedH Hartley Sweeten
The symbol ni_mio_cs_driver is only referenced in this file. Make it static. 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>
2012-09-17staging: comedi: ni_labpc_cs: local symbols should not be exportedH Hartley Sweeten
The symbol labpc_cs_driver and the functions labpc_init_module() and labpc_exit_module() are only referenced in this file. Make them static. 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>
2012-09-17staging: comedi: ni_daq_dio24: local symbols should not be exportedH Hartley Sweeten
The symbol dio24_cs_driver is only referenced in this file. Make it static. 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>
2012-09-17staging: comedi: ni_pcidio: local functions should not be exportedH Hartley Sweeten
The function ni_pcidio_event() is only referenced in this file. Make it static. 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>
2012-09-17staging: comedi: ni_660x: local functions should not be exportedH Hartley Sweeten
The function ni_660x_release_mite_channel() is only referenced in this file. Make it static. 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>
2012-09-17staging: comedi: jr3_pci: local functions should not be exportedH Hartley Sweeten
The function read_idm_word() is only referenced in this file. Make it static. 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>
2012-09-17staging: comedi: jr3_pci.h: remove vect_bits_t and warning_bits_tH Hartley Sweeten
Leave the enum's but remove their names. The names are not used anywhere in 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>
2012-09-17staging: comedi: ni_mio_common: make internal functions staticH Hartley Sweeten
The functions ni_release_gpct_mite_channel() and ni_prime_channelgain_list() are only referenced in this file. Make it static. The function ni_release_gpct_mite_channel() is also only called when PCIDMA is enabled. Move the #ifdef to quite a sparse warning about the function not being 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>
2012-09-17staging: comedi: comedi_fops: make internal function staticH Hartley Sweeten
The function do_become_nonbusy() is only referenced in this file. Make it static. 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>
2012-09-17staging: sm7xxfb: remove smtc_VRAMBaseAddressJavier M. Mellid
This patch erases smtc_VRAMBaseAddress variable. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: sm7xxfb: rename pFramebufferPhysical to mmio_baseJavier M. Mellid
This patch renames pFramebufferPhysical name to mmio_base. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: sm7xxfb: rename some smtcfb_info fieldsJavier M. Mellid
This patch improves naming style and comments on smtcfb_info fields. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: sm7xxfb: annotate iomem pointersJavier M. Mellid
This patch annotates iomem pointers. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: sm7xxfb: cleanup on smtc_alloc_fb_infoJavier M. Mellid
This patch improves code legibility after last changes. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: sm7xxfb: clean smtcfb_fix's id initializationJavier M. Mellid
Setting up smtcfb_fix's id happens through smtc_alloc_fb_info. It adds complexity and unnecesary code. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: sm7xxfb: clean fb_fix_screeninfo and fb_var_screeninfo initializationJavier M. Mellid
Part of fb_fix_screeninfo and fb_var_screeninfo initialization happens in smtc_alloc_fb_info. It duplicates code while hiding the real functionality of smtc_alloc_fb_info. This patch groups initialization together. Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: "wlags49_h25" Fix typos.Justin P. Mattock
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: csr: wait for the exec in usermodehelperLauri Hintsala
The order of wait values has been changed by commit 9d944ef32e. Fix the wait parameter and start to use a define instead of "magic number". Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: fix csr printk format warningRandy Dunlap
Fix printk format warning on i386/X86_32 by using 't' for ptrdiff_t. Also builds cleanly on x86_64. drivers/staging/csr/csr_wifi_hip_udi.c: In function 'unifi_print_status': drivers/staging/csr/csr_wifi_hip_udi.c:151:27: warning: format '%ld' expects type 'long int', but argument 5 has type 'int' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17Merge tag 'iio-for-v3.7d' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next IIO new drivers, features and rework for the 3.7 cycle, 4th set. Here we have 1) a set cleaning up and moving the ad7476 driver out of staging. Support for a number of additional parts is also added to that driver. 2) cleanups from various people for the in kernel interface code as that is getting more an more real use and hence people are picking up on minor issues that made it through review. Also a related useful set of utility functions to avoid duplicate code for converting IIO representations to other forms. 3) a new fractional type for our read_raw / write_raw functions. This allows avoiding loss of accuracy via the in kernel interfaces in some cases as well as being rather convenient for a lot of range -> scale conversions. 4) New AD5755 DAC driver. 5) Some Blackfin timer trigger improvements including hardware pulse control for device triggering. 6) Support for the ad7091r in the ad7476 driver.
2012-09-17iio: ad7476: Add support for the ad7091rLars-Peter Clausen
Add support for the ad7091r 12 bit ADC to the ad7476 driver. Although the ad7091r is not really related to any of the other devices supported by this driver, luckily for us there are not so many ways (which are not totally insane) how sampling a single channel ADC via SPI can be implemented and support for the ad7091r can be added to the driver with just a few adjustments. The ad7091r requires an external "conversion start" pulse to start a sample conversion. After the conversion has finished the result can be read via SPI. We depend on a IIO trigger to generate this signal, as a result only sampling in buffered mode and not in manual mode is available. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17staging:iio:trigger:bfintmr Add output supportLars-Peter Clausen
Some converters require an external signal to start the conversion. This patch adds support to the bfintmr trigger driver to generate such a signal. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17staging:iio:trigger:bfintmr: Only enable timer when necessaryLars-Peter Clausen
This patch hooks up the set_trigger_state callback for the blackfin timer trigger driver and only enables the timer when a trigger consumer requests it to be enabled. There really is no reason to keep the timer running and generate interrupts if nobody is listening to them. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17staging:iio:trigger:bfintmr: Avoid divide by zeroLars-Peter Clausen
If the timer frequency has not been configured yet get_gptimer_period() will return 0. Handle this case instead of blindly dividing by the returned value. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17staging:iio:hwmon bridge: Use iio_read_channel_processedLars-Peter Clausen
Use the iio_read_channel_processed function to read the sample value in the proper unit instead of using iio_read_channel_raw and iio_read_channel_scale and doing the unit conversion manually. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17iio:inkern: Add function to read the processed valueLars-Peter Clausen
Add a function to read a processed value from a channel. The function will first attempt to read the IIO_CHAN_INFO_PROCESSED attribute. If that fails it will read the IIO_CHAN_INFO_RAW attribute and convert the result from a raw value to a processed value. The patch also introduces a function to convert raw value to a processed value and exports it, in case a user needs or wants to do the conversion by itself. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17iio: consumer.h: Fix kernel doc incosistencyLars-Peter Clausen
For the iio_read_channel_raw and iio_read_channel_scale the kerneldoc comment refers to an argument called "channel", while the argument is called "chan" in the function signature. This leads to the following warnings from kerneldoc: Warning(include/linux/iio/consumer.h:71): No description found for parameter 'chan' Warning(include/linux/iio/consumer.h:71): Excess function parameter 'channel' description in 'iio_read_channel_raw' Warning(include/linux/iio/consumer.h:109): No description found for parameter 'chan' Warning(include/linux/iio/consumer.h:109): Excess function parameter 'channel' description in 'iio_read_channel_scale' This patch fixes the warnings by naming them consistently. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-17iio:dac: Add ad5755 driverLars-Peter Clausen
This patch adds support for the AD5755, AD5755-1, AD5757, AD5735, AD5737 16 and 14 bit quad-channel DACs. The AD5757/AD5737 only have current outputs, but for the AD5755/AD5757 each of the outputs can be configured to either be a voltage or a current output. We only allow to configure this at device probe time since usually this needs to match the external circuitry and should not be changed on the fly. A few trivial formatting changes on merge. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>