anish kumar [Fri, 21 Sep 2012 16:10:00 +0000 (17:10 +0100)]
power: battery: Generic battery driver using IIO
Driver to allow use of the ADC drivers supported by the IIO
subsystem for battery status monitoring. Connecting this
driver to the relevant IIO device requires registration of
the appropriate iio_map structure array by the IIO device
driver (usually from platform data). If specified the driver
will also make use of a gpio to provide interrupt driven
notification that the battery is fully charged.
In last version:
Addressed concerns raised by lars:
a. made the adc_bat per device.
b. get the IIO channel using hardcoded channel names.
c. Minor issues related to gpio_is_valid and some code
refactoring.
In V1:
Addressed concerns raised by Anton:
a. changed the struct name to gab(generic adc battery).
b. Added some functions to neaten the code.
c. Some minor coding guidelines changes.
d. Used the latest function introduce by lars:
iio_read_channel_processed to streamline the code.
In V2:
Addressed concerns by lars:
a. No need of allocating memory for channels.Make it array.
b. Code restructring, coding style and following kernel guidelines changes
suggested by him.
In V3:
Addressed conerns by Anton:
a. Added the copyright.
b. Coding guidelines changes suggested by him.
c. Added Makefile and Kconfig
Signed-off-by: anish kumar <anish198519851985@gmail.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Axel Lin [Wed, 19 Sep 2012 15:30:00 +0000 (16:30 +0100)]
HID: hid-sensor-hub: Fix sensor_hub_probe error handling
Fix below issues:
1. In the case of goto err_close, hid_hw_stop(hdev) is called twice. Fix it.
2. If fails to allocate MFD device name, we also need to free all
successfully allocated names in previous iterations.
3. In sensor_hub_remove(), Call hid_hw_close() before hid_hw_stop().
4. Adjust unnecessary change lines for hid_err.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Axel Lin [Wed, 19 Sep 2012 15:30:00 +0000 (16:30 +0100)]
HID: hid-sensor-hub: Remove hdev->claimed setting
Current implementation of hid_hw_start() allows connect_mask to be 0.
Setting hdev->claimed = HID_CLAIMED_INPUT before calling hid_hw_start()
is not necessary. Remove it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Kim, Milo [Mon, 17 Sep 2012 09:35:00 +0000 (10:35 +0100)]
iio: adc: add new lp8788 adc driver
TI LP8788 PMU provides regulators, battery charger, ADC,
RTC, backlight driver and current sinks.
This patch enables the LP8788 ADC functions.
The LP8788 ADC has several ADC input selection and supports 12bit resolution.
Internal operation of getting ADC is access to registers of LP8788.
The LP8788 ADC uses exported functions for accessing these registers.
(exported by LP8788 MFD device driver)
This driver supports IIO_CHAN_INFO_RAW and SCALE.
So the IIO consumer can calculate the value with raw and scale.
The unit of scale is micro.
(ADC Input Selection)
Voltage: battery voltage (MAX 5.0, 5.5 and 6.0V)
charger input voltage
four general ADC inputs
coin cell voltage
Current: battery charging current
Temperature: IC temperature
(The IIO map for the IIO consumer)
The ADC input is configurable in the platform side.
Even though this platform data is not defined,
the default IIO map is created for supporting the power supply driver.
The battery voltage and temperature are used inside this driver.
(History)
Patch v6.
(a) Fix scale value for each ADC input selection
Voltage and current type are mili unit and temperature is degree.
To calculate the IC temperature,
temp = raw * scaleint + (raw * scalepart)/
1000000, scaleint is always 0.
= raw * 0.061050, raw: 0 ~ 4095
Then range of IC temperature(ADC result) is 0 ~ 250'C
(b) Reorganization of the IIO channel Spec
Remove address, scan_type and scan_index and rollback the datasheet name.
The reason why 'address' field is unnecessary is no relation with each channel.
Moreover, to get the raw ADC value, the address info is not only one register
but also several registers.
Therefore specific function(lp8788_get_adc_result) is called rather than
using one 'address' field.
(c) Fix coding style
Remove duplicated checking routine while unregistering the IIO map.
Fix code for space and parenthesis.
Patch v5.
Fix default consumer name as 'lp8788-charger'.
Add mutex for ADC read operation.
Reorganization on lp8788_adc_read_raw().
Patch v4.
Fix adc_raw function: support RAW and SCALE channel info.
Change LP8788 ADC platform data - iio map.
Enables the default IIO map.
Patch v3.
Fix wrong size of allocating iio private data.
Fix coding styles.
Patch v2.
Support RAW and SCALE interface for IIO consumer.
Clean up the iio channel spec macro.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Lars-Peter Clausen [Fri, 21 Sep 2012 13:29:00 +0000 (14:29 +0100)]
staging:iio:ad7780: Add support for the ad7170/ad7171
The ad7170/ad7171 have a software interface similar to the ad7780. They do not
have an external pin which allows to change the internal gain and the what is
used for the gain bit in the ad7780/ad7781 becomes part of the check pattern.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Lars-Peter Clausen [Fri, 21 Sep 2012 13:29:00 +0000 (14:29 +0100)]
staging:iio:ad7780: Make powerdown GPIO optional
Some designs hardwire the PDRST pin to always on. In this case there is no GPIO
to control the mode of the device, so make the GPIO optional. Since now all of
the the platform data fields are optional now, make the platform data as a whole
optional as well.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:sca3000: Do not return a error in remove function
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 errors which the driver tries to handle in the remove function are
non-critical, so we can just ignore them 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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:lis3l02dq: Do not return a error in remove function
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 errors which the driver tries to handle in the remove function are
non-critical, so we can just ignore them 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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:
ade7759: Do not return a error in remove function
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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:
ade7758: Do not return a error in remove function
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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:
ade7754: Do not return a error in remove function
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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:
ade7753: Do not return a error in remove function
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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:adis16400: Do not return a error in remove function
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>
Lars-Peter Clausen [Sat, 22 Sep 2012 08:56:00 +0000 (09:56 +0100)]
staging:iio:adis16200: Do not return a error in remove function
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>
Kim, Milo [Tue, 18 Sep 2012 04:56:00 +0000 (05:56 +0100)]
iio: inkern: clean up error return code
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>
Kim, Milo [Tue, 18 Sep 2012 04:55:00 +0000 (05:55 +0100)]
iio: inkern: put the IIO device when it fails to allocate memory
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>
Dan Carpenter [Wed, 19 Sep 2012 06:27:00 +0000 (07:27 +0100)]
iio: dac/ad5755: signedness bug in ad5755_setup_pdata()
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>
Srinivas Pandruvada [Thu, 20 Sep 2012 00:15:00 +0000 (01:15 +0100)]
iio: hid-sensors: Prevent crash during hot-unplug
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>
Dan Carpenter [Fri, 14 Sep 2012 06:53:46 +0000 (06:53 +0000)]
HID: sensors: remove some unneeded checks
"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>
Dan Carpenter [Fri, 14 Sep 2012 06:53:23 +0000 (06:53 +0000)]
HID: sensors: use GFP_ATOMIC under spinlock
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>
Stephen Rothwell [Wed, 12 Sep 2012 06:07:00 +0000 (07:07 +0100)]
HID: sensors: fix up for mfd_add_devices() API change
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Greg Kroah-Hartman [Tue, 18 Sep 2012 06:02:36 +0000 (23:02 -0700)]
Staging: remove CONFIG_EXPERIMENTAL dependancies
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>
Greg Kroah-Hartman [Tue, 18 Sep 2012 04:25:28 +0000 (21:25 -0700)]
Staging:
ced1401: fix copy_from/to_user warning messages
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>
Greg Kroah-Hartman [Tue, 18 Sep 2012 04:12:59 +0000 (21:12 -0700)]
Staging
ced1401: cleanup coding style issues.
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>
Greg Kroah-Hartman [Tue, 18 Sep 2012 02:43:33 +0000 (19:43 -0700)]
Staging:
ced1401: add driver to the build
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>
Greg Kroah-Hartman [Tue, 18 Sep 2012 02:42:05 +0000 (19:42 -0700)]
Staging:
ced1401: add TODO file
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>
Greg Kroah-Hartman [Tue, 18 Sep 2012 02:36:03 +0000 (19:36 -0700)]
Staging:
ced1401: usb1401: fix build errors.
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>
Alois Schlögl [Tue, 18 Sep 2012 02:22:52 +0000 (19:22 -0700)]
Staging: add
ced1401 USB driver
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:17:19 +0000 (13:17 -0700)]
staging: comedi: jr3_pci: quiet "Using plain interger as NULL pointer" noise
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:17:03 +0000 (13:17 -0700)]
staging: comedi: pcmuio: pointers should be cleared with NULL
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:16:45 +0000 (13:16 -0700)]
staging: comedi: pcmmio: remove kernel messages about IRQ
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:16:05 +0000 (13:16 -0700)]
staging: comedi: mite: local symbols should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:15:32 +0000 (13:15 -0700)]
staging: comedi: ni_mio_cs: local symbols should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:15:15 +0000 (13:15 -0700)]
staging: comedi: ni_labpc_cs: local symbols should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:14:59 +0000 (13:14 -0700)]
staging: comedi: ni_daq_dio24: local symbols should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:14:41 +0000 (13:14 -0700)]
staging: comedi: ni_pcidio: local functions should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:14:24 +0000 (13:14 -0700)]
staging: comedi: ni_660x: local functions should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:14:08 +0000 (13:14 -0700)]
staging: comedi: jr3_pci: local functions should not be exported
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:13:48 +0000 (13:13 -0700)]
staging: comedi: jr3_pci.h: remove vect_bits_t and warning_bits_t
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:13:32 +0000 (13:13 -0700)]
staging: comedi: ni_mio_common: make internal functions static
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>
H Hartley Sweeten [Mon, 17 Sep 2012 20:13:12 +0000 (13:13 -0700)]
staging: comedi: comedi_fops: make internal function static
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>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:53 +0000 (16:12 +0200)]
staging: sm7xxfb: remove smtc_VRAMBaseAddress
This patch erases smtc_VRAMBaseAddress variable.
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:52 +0000 (16:12 +0200)]
staging: sm7xxfb: rename pFramebufferPhysical to mmio_base
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>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:51 +0000 (16:12 +0200)]
staging: sm7xxfb: rename some smtcfb_info fields
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>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:50 +0000 (16:12 +0200)]
staging: sm7xxfb: annotate iomem pointers
This patch annotates iomem pointers.
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:49 +0000 (16:12 +0200)]
staging: sm7xxfb: cleanup on smtc_alloc_fb_info
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>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:48 +0000 (16:12 +0200)]
staging: sm7xxfb: clean smtcfb_fix's id initialization
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>
Javier M. Mellid [Mon, 17 Sep 2012 14:12:47 +0000 (16:12 +0200)]
staging: sm7xxfb: clean fb_fix_screeninfo and fb_var_screeninfo initialization
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>
Justin P. Mattock [Mon, 17 Sep 2012 15:20:24 +0000 (08:20 -0700)]
staging: "wlags49_h25" Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Lauri Hintsala [Mon, 17 Sep 2012 13:26:31 +0000 (16:26 +0300)]
staging: csr: wait for the exec in usermodehelper
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>
Randy Dunlap [Mon, 17 Sep 2012 17:33:18 +0000 (10:33 -0700)]
staging: fix csr printk format warning
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>
Greg Kroah-Hartman [Mon, 17 Sep 2012 21:42:54 +0000 (14:42 -0700)]
Merge tag 'iio-for-v3.7d' of git://git./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.
Lars-Peter Clausen [Mon, 17 Sep 2012 12:26:00 +0000 (13:26 +0100)]
iio: ad7476: Add support for the ad7091r
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 12:26:00 +0000 (13:26 +0100)]
staging:iio:trigger:bfintmr Add output support
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 12:26:00 +0000 (13:26 +0100)]
staging:iio:trigger:bfintmr: Only enable timer when necessary
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 12:26:00 +0000 (13:26 +0100)]
staging:iio:trigger:bfintmr: Avoid divide by zero
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 12:17:00 +0000 (13:17 +0100)]
staging:iio:hwmon bridge: Use iio_read_channel_processed
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 12:17:00 +0000 (13:17 +0100)]
iio:inkern: Add function to read the processed value
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 12:17:00 +0000 (13:17 +0100)]
iio: consumer.h: Fix kernel doc incosistency
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>
Lars-Peter Clausen [Mon, 17 Sep 2012 09:24:00 +0000 (10:24 +0100)]
iio:dac: Add ad5755 driver
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>
Kim, Milo [Mon, 17 Sep 2012 08:44:00 +0000 (09:44 +0100)]
iio: inkern: add error case in iio_channel_get()
The datasheet name is defined in the IIO driver.
On the other hand, the adc_channel_label is configured in
the platform side.
If the datasheet name is not matched with any adc_channel_label,
the iio_channel_get() should be returned as error for preventing
invalid channel data access.
This can be handled either way.
(a) checking null data when using it : in the xxx_read_raw()
or
(b) error returns when the channel is requested : this patch
The IIO consumer can't use the channel with invalid channel spec.
Therefore case (b) is more reasonable.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Macpaul Lin [Fri, 14 Sep 2012 06:02:04 +0000 (14:02 +0800)]
staging/gdm72xx: usb_boot: replace firmware upgrade API in em_download
Replace firmware upgrade API in em_download_image().
Signed-off-by: Macpaul Lin <macpaul@gmail.com>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ben Chan <benchan@chromium.org>
Cc: Sage Ahn <syahn@gctsemi.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Toshiaki Yamane [Sun, 16 Sep 2012 07:26:38 +0000 (16:26 +0900)]
staging/rts_pstor: Use pr_ or dev_ printks in rtsx.c
fixed some checkpatch warnings.
-WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...
-WARNING: quoted string split across lines
And added pr_fmt.
Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:12:36 +0000 (06:12 -0700)]
Staging: silicom: checkpatch.pl cleanup: pretty pointers
last of the unstylistic pointers cleaned up
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:12:05 +0000 (06:12 -0700)]
Staging: silicom: checkpatch.pl cleanup: pretty pointers
pointer style cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:11:41 +0000 (06:11 -0700)]
Staging: silicom: checkpatch.pl cleanup: pretty pointers
more checkpatch cleanups of pointers.
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:11:15 +0000 (06:11 -0700)]
Staging: silicom: checkpatch.pl cleanup: pretty pointers
More pointer style cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:10:49 +0000 (06:10 -0700)]
Staging: silicom: checkpatch.pl cleanup: pretty pointers
More notation fixes
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:10:21 +0000 (06:10 -0700)]
Staging: silicom: checkpatch.pl cleanup: pretty pointers
first chunk, straighten up the pointer notation
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:09:54 +0000 (06:09 -0700)]
Staging: silicom: checkpatch cleanup: fix includes
checkpatch fixups
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:09:26 +0000 (06:09 -0700)]
Staging: silicom: checkpatch cleanup: header file whitespace
Finish trailing spaces in libbp_sd.h
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:09:00 +0000 (06:09 -0700)]
Staging: silicom: checkpatch cleanup: header file whitespace
Whack all the line ending spaces so checkpatch.pl is happy.
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:08:36 +0000 (06:08 -0700)]
Staging: silicom: bypass.h: checkpatch whitespace
Remove trailing spaces, second chunk
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:08:07 +0000 (06:08 -0700)]
Staging: silicom: bypass.h: checkpatch whitespace
Remove trailing spaces, first chunk
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:06:44 +0000 (06:06 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
twelfth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:06:20 +0000 (06:06 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
eleventh chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:05:51 +0000 (06:05 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
tenth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:04:41 +0000 (06:04 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
ninth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:04:06 +0000 (06:04 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
eighth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:03:43 +0000 (06:03 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
seventh chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:03:18 +0000 (06:03 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
sixth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:02:52 +0000 (06:02 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
fifth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:02:22 +0000 (06:02 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
fourth chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:01:40 +0000 (06:01 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
third chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 13:00:41 +0000 (06:00 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
second chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Daniel Cotey [Sat, 15 Sep 2012 12:59:07 +0000 (05:59 -0700)]
Staging: silicom: bp_mod.h: checkpatch tab and space cleanup
first chunk of bp_mod.h's cleanup
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ben Hutchings [Sun, 16 Sep 2012 03:18:50 +0000 (04:18 +0100)]
staging: speakup_soft: Fix reading of init string
softsynth_read() reads a character at a time from the init string;
when it finds the null terminator it sets the initialized flag but
then repeats the last character.
Additionally, if the read() buffer is not big enough for the init
string, the next read() will start reading from the beginning again.
So the caller may never progress to reading anything else.
Replace the simple initialized flag with the current position in
the init string, carried over between calls. Switch to reading
real data once this reaches the null terminator.
(This assumes that the length of the init string can't change, which
seems to be the case. Really, the string and position belong together
in a per-file private struct.)
Tested-by: Samuel Thibault <sthibault@debian.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Devendra Naga [Sun, 16 Sep 2012 16:01:59 +0000 (12:01 -0400)]
staging: silicom: fix a comparing proc_dir_entry pointer against 0
we should be using the NULL macro, not 0 to compare against
a pointer value, and also remove braces around the single
if conditional after the create_proc_entry
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Devendra Naga [Sun, 16 Sep 2012 17:49:40 +0000 (13:49 -0400)]
staging: ft1000: replace c99 comments with c88
replace some of the c99 comments to the structures with c88 comment style
no code change is done here.
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Fri, 14 Sep 2012 08:11:35 +0000 (11:11 +0300)]
Staging: silicom: use kstrtoint_from_user()
The main problem with the hand rolled code was that there weren't any
range checks so you could corrupt memory by writing too much data to
the proc file.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Fri, 14 Sep 2012 06:56:00 +0000 (09:56 +0300)]
Staging: silicom: add some range checks to proc functions
If you tried to cat more than 255 characters (the last character is for
the terminator) to these proc files then it would corrupt kernel memory.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Cotey <puff65537@bansheeslibrary.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:35 +0000 (17:34 +0100)]
staging: comedi: mite: use module_init()/module_exit()
Rename the standard `init_module()` and `cleanup_module()` functions and
make them static. Use `module_init()` and `module_exit()` to mark the
renamed functions as the module init and exit functions.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:34 +0000 (17:34 +0100)]
staging: comedi: mite: remove list of devices
All the drivers that use the "mite" module now allocate a `struct
mite_struct` dynamically instead of searching the `mite_devices` list
populated during initialization of the "mite" module.
Remove the list of devices and the function that prints available NI
devices on the list (`mite_list_devices()`). The list node and `used`
members in `struct mite_struct` are now redundant, so remove them.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:33 +0000 (17:34 +0100)]
staging: comedi: ni_pcimio: use mite_alloc()
Allocate `struct mite_device` dynamically instead of searching for
one on the `mite_devices` list constructed by the "mite" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:32 +0000 (17:34 +0100)]
staging: comedi: ni_pcidio: use mite_alloc()
Allocate `struct mite_device` dynamically instead of searching for
one on the `mite_devices` list constructed by the "mite" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:31 +0000 (17:34 +0100)]
staging: comedi: ni_labpc: use mite_alloc()
Allocate `struct mite_device` dynamically instead of searching for
one on the `mite_devices` list constructed by the "mite" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:30 +0000 (17:34 +0100)]
staging: comedi: ni_670x: remove spurious free_irq() call
This driver's comedi `detach` handler (`ni_670x_detach()`) calls
`free_irq()` but the driver doesn't call `request_irq()` anywhere.
Remove the spurious call.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:29 +0000 (17:34 +0100)]
staging: comedi: ni_670x: use mite_alloc()
Allocate `struct mite_device` dynamically instead of searching for
one on the `mite_devices` list constructed by the "mite" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:28 +0000 (17:34 +0100)]
staging: comedi: ni_660x: use mite_alloc()
Allocate `struct mite_device` dynamically instead of searching for
one on the `mite_devices` list constructed by the "mite" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ian Abbott [Fri, 14 Sep 2012 16:34:27 +0000 (17:34 +0100)]
staging: comedi: ni_65xx: use mite_alloc()
Allocate `struct mite_device` dynamically instead of searching for
one on the `mite_devices` list constructed by the "mite" module.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>