summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Staging: speakup: speakup_bns: fix commentVitali Liaukovich2017-01-311-1/+1
| | | | | | | Fixed comment formatting issue. Signed-off-by: Vitali Liaukovich <vitali.liaukovich@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: speakup - syle fix permissions to octalDerek Robson2017-01-3117-211/+211
| | | | | | | | A style fix across whole driver. changed permissions to octal style, found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: Fix coding style errorsMaxime Rossi Bellom2017-01-271-5/+5
| | | | | | | | | | | Replace a mix of tabs and spaces indentation by tabs only. Errors were reported by checkpatch.pl as WARNING: Statements should start on a tabstop WARNING: suspect code indent for conditional statement Signed-off-by: Maxime Rossi Bellom <mrossibellom@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8188eu: Fix coding style issuesWilliam Blough2017-01-271-64/+64
| | | | | | | Convert leading spaces to tabs Signed-off-by: William Blough <devel@blough.us> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: xgifb: XGI_main_26: Remove multiple assignmentssayli karnik2017-01-271-10/+21
| | | | | | | | This patch resolves the checkpatch issue: multiple assignments should be avoided Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: bcm2835-audio: initial staging submissionMichael Zoran2017-01-2710-0/+2634
| | | | | | | | | | | | | | | | | | | Initial cleanup of bcm2835-audio driver for the bcm2535(Raspberry PI) Driver provides HDMI audio through ALSA and is built on top of the vc04_services driver. Original version of the driver is available at: http://www.github.com/raspberry/linux Driver compiles without any build errors or warnings. Tested on a RPI 3 running in ARM64 mode with the vlc player and alsautils. Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rtl8192u: add endianness conversionsColin Vidal2017-01-271-4/+4
| | | | | | | | | | Fields frag_size and playload_size of struct ieee80211_txb are encoded as short little-endian. This patch adds conversions to / from cpu byte order when copy / write these values in variables of architecture independent byte order. It also avoid a sparse type warning. Signed-off-by: Colin Vidal <colin@cvidal.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8192u: Adding space after ','simran singhal2017-01-271-4/+4
| | | | | | | This patch fixes the checkpatch issue by adding space after ','. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8192u: Adding space around '='simran singhal2017-01-271-4/+4
| | | | | | | This patch fixes the checkpatch issue by adding space around '='. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: vt6656: Add missing identifier names=?UTF-8?q?Simon=20Sandstr=C3=B6m?=2017-01-271-16/+18
| | | | | | | | Fix multiple checkpatch.pl warnings: function definition argument '...' should also have an identifier name Signed-off-by: Simon Sandström <simon@nikanor.nu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: llite: use octal permissionsErnestas Kulik2017-01-274-6/+6
| | | | | | | Using octal permissions instead of symbolic ones is preferred. Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: libcfs: use octal permissionsErnestas Kulik2017-01-271-2/+2
| | | | | | | Using octal permissions instead of symbolic ones is preferred. Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: ptlrpc: avoid warning on missing returnArnd Bergmann2017-01-271-0/+1
| | | | | | | | | | | | | | | | The newly added function triggers a harmless warning: drivers/staging/lustre/lustre/ptlrpc/pack_generic.c: In function 'lustre_shrink_msg': drivers/staging/lustre/lustre/ptlrpc/pack_generic.c:472:1: error: control reaches end of non-void function [-Werror=return-type] This probably happens because LASSERTF() contains an 'unlikely()' that sometimes prevents gcc from analysing the control flow correctly. Adding a return statement here seems harmless and lets us keep that unlikely(). Fixes: 96049bd1ecd0 ("staging: lustre: ptlrpc: embed highest XID in each request") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: most: hdm-usb: fix symbolic permissions warningSebastian Haas2017-01-271-3/+3
| | | | | | | | Replace symbolic permissions with their octect representation to fix checkpatch warnings. Signed-off-by: Sebastian Haas <sehaas@deebas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fbtft: fix unaligned parenthesesUmang Raghuvanshi2017-01-271-5/+5
| | | | | | | | Fix the following formatting issues: CHECK: Alignment should match open parenthesis Signed-off-by: Umang Raghuvanshi <u@umangis.me> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: loopback: fix broken udelayJohan Hovold2017-01-271-2/+7
| | | | | | | | | | | | | | | | | | | The loopback driver allows the user to set a minimum delay of up to one second to be inserted between test iterations (i.e. request submissions). The delay is currently specified in microseconds and is implemented using udelay. Busy looping for long periods is not just anti-social; udelay must not be used for delays longer than a few milliseconds due to the risk of integer overflow. Replace the broken udelay with a usleep_range with a 100 us range for short delays (< 20 ms) and otherwise revert to using msleep. Fixes: b36f04fa9417 ("greybus: loopback: Convert thread delay to microseconds") Signed-off-by: Johan Hovold <johan@kernel.org> Cc: stable <stable@vger.kernel.org> # 4.9+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: sdio: Prefer u32 over uint32_tFranck Demathieu2017-01-271-1/+1
| | | | | | | | | | It fixes the following issue reported by checkpatch.pl: Prefer kernel type 'u32' over 'uint32_t' Signed-off-by: Franck Demathieu <fdemathieu@gmail.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: uart: fix TIOCGSERIAL flagsJohan Hovold2017-01-271-1/+0
| | | | | | | | | | | This driver does not have a low-latency mode and should not report anything else. Also drop the skip-test flag which isn't used either. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fbtft: fix checkpatch decimal permissions errorAbdul Rauf2017-01-258-32/+32
| | | | | | | | Fix the following errors: Use 4 digit octal (0777) not decimal permissions Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rtl8712: fix spelling errorsJoseph Wright2017-01-255-12/+12
| | | | | | | | | | | Found by checkpatch: - s/cacluated/calculated/ - s/convertor/converter/ - s/psudo/pseudo/ - s/halfs/halves/ Signed-off-by: Joseph Wright <rjosephwright@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: fbtft: remove duplicate entries of ili9225Amitesh Singh2017-01-251-16/+0
| | | | | | | | | There are multiple entries for ili9225 display defined in flexfb_chip_table array. remove duplicate entries and keep single entry. Signed-off-by: Amitesh Singh <singh.amitesh@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: media: lirc: use new parport device modelSudip Mukherjee2017-01-231-31/+62
| | | | | | | Modify lirc_parallel driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change msg union in struct lnet_hdr to proper structureJames Simmons2017-01-231-15/+15
| | | | | | | | | | | | | | | Modify all the msg union fields from typedefs to to proper structures. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_hdr_t to proper structureJames Simmons2017-01-2314-91/+91
| | | | | | | | | | | | | | Change lnet_hdr_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_magicversion_t to proper structureJames Simmons2017-01-234-15/+15
| | | | | | | | | | | | | | Change lnet_magicversion_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_acceptor_connreq_t to proper structureJames Simmons2017-01-232-5/+5
| | | | | | | | | | | | | | Change lnet_acceptor_connreq_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_process_id_packed_t to proper structureJames Simmons2017-01-234-12/+12
| | | | | | | | | | | | | | Change lnet_process_id_packed_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_ni_status_t to proper structureJames Simmons2017-01-234-7/+7
| | | | | | | | | | | | | | Change lnet_ni_status_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_ping_info_t to proper structureJames Simmons2017-01-235-30/+30
| | | | | | | | | | | | | | Change lnet_ping_info_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: lustre: lnet: change lnet_handle_wire_t to proper structureJames Simmons2017-01-235-15/+15
| | | | | | | | | | | | | | Change lnet_handle_wire_t from typedef to proper structure. Signed-off-by: James Simmons <uja.ornl@yahoo.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142 Reviewed-on: https://review.whamcloud.com/24566 Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com> Reviewed-by: Olaf Weber <olaf@sgi.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: audio_gb.c: Change uint32_t to u32Marcos Paulo de Souza2017-01-231-2/+2
| | | | | | | | | | | | | | | Change uint32_t to u32, solved the issue reported by checkpatch.pl: CHECK: Prefer kernel type 'u32' over 'uint32_t' + uint32_t *format, uint32_t *rate, u8 *channels, CHECK: Prefer kernel type 'u32' over 'uint32_t' + uint32_t format, uint32_t rate, u8 channels, Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: rtl8188eu: os_dep: usb_ops_linux.c - style fixDerek Robson2017-01-231-1/+1
| | | | | | | | Fixed comparison, moved the constant to the right side of the test Found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8192u: Adding space around '='simran singhal2017-01-231-1/+1
| | | | | | | This patch fixes the checkpatch issue by adding space around '='. Signed-off-by: simran singhal <singhalsimran0@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* iio: accel: fix Kconfig warningLinus Walleij2017-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 762227721fe6225be5b6d233ef681aea5871f5f3 "iio: accel: st_accel: handle deprecated bindings" attempted to be smart and let users use the old I2C driver and the new SPI driver, or the old SPI driver and the new I2C driver in combination for the LIS3LV02, and put the restrictions on the I2C and SPI subdrivers not not be combined with the old subdrivers. This doesn't work since the IIO ST accel top-level component selects the I2C and SPI subdrivers, resulting in the following Kconfig noise: warning: (IIO_ST_ACCEL_3AXIS) selects IIO_ST_ACCEL_I2C_3AXIS which has unmet direct dependencies (IIO && !SENSORS_LIS3_I2C && IIO_ST_ACCEL_3AXIS && IIO_ST_SENSORS_I2C) warning: (IIO_ST_ACCEL_3AXIS) selects IIO_ST_ACCEL_SPI_3AXIS which has unmet direct dependencies (IIO && !SENSORS_LIS3_SPI && IIO_ST_ACCEL_3AXIS && IIO_ST_SENSORS_SPI) (...) This fixes the issue by putting the dependencies directly in the top-level component instead, so that it never gets to select its unselectable subcomponent. Fixes: 762227721fe6 ("iio: accel: st_accel: handle deprecated bindings") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'iio-for-4.11b' of ↵Greg Kroah-Hartman2017-01-2339-205/+2790
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into work-next Jonathan writes: Second round of IIO new device support, cleanups and features for the 4.11 cycle New device support: * lsm6dsx imu - new driver and bindings. * max11100 adc - new driver and bindings. * tlc4541 - new driver * tmp007 thermopile - new driver. Core * in kernel interfaces - pass through raw values if no scaling provided and a processed value is requested. * trigger - close a race condition in acquiring trigger reference. - constify device_type structures. - rework the viio_trigger_alloc function to be much neater and easier to read. - free trigger resources correctly on some error paths. Avoids putting a module we don't have. Documentation * ABI - specify a unit for proximity measurements. Cleanups and features * ads1015 - constify iio_info structure. * ads7950 cleanups following merge in previous pull - Add device tree bindings - Drop the ti prefix from the module name in common with other drivers. - Change regulator name to vref to match datasheet and other drivers. * ak8974 - remove a redundant zero timeout check. * bmi160 - use variable names for sizeof instead of types. * cm3605 - mark PM functions as __maybe_unused to avoid a build warning. * isl29028 (on it's way towards moving out of staging). - alignment fixes and newline improvements. - combine proxim_get and read_proxim for simpler code. - drop unused ISL29028_DEV_ATTR macro - move some error logging into functions to cut out repitition. - make error messages more consistent. - tidy up some brackets. - drop the enable flag that nothing uses. - only set proximity rate and ALS scale when relevant channel type is enabled. - runtime pm support. * lsm6dsx - fix wrong values for gyro sensitivitiy. * mag3110 - claim direct mode during sysfs reads to avoid a race condition. * max1363 - export OF device table IDs as module aliases. * max30100 - use msleep for long uncritical delays. * mcp4531 - export OF device table as module aliases. * ms5611 - claim direct mode during sysfs reads to avoid a race condition. * opt3001 - export OF device table as module aliases. * sx9500 - claim direct mode during oversampling changes to avoid a race condition.
| * iio: trigger: free trigger resource correctlyAlison Schofield2017-01-223-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These stand-alone trigger drivers were using iio_trigger_put() where they should have been using iio_trigger_free(). The iio_trigger_put() adds a module_put which is bad since they never did a module_get. In the sysfs driver, module_get/put's are used as triggers are added & removed. This extra module_put() occurs on an error path in the probe routine (probably rare). In the bfin-timer & interrupt trigger drivers, the module resources are not explicitly managed, so it's doing a put on something that was never get'd. It occurs on the probe error path and on the remove path (not so rare). Tested with the sysfs trigger driver. The bfin & interrupt drivers were build tested & inspected only. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: trigger: clean up viio_trigger_alloc()Dan Carpenter2017-01-221-35/+34
| | | | | | | | | | | | | | | | | | | | | | 1) Reverse the test for kmalloc() failure so we can pull everything back one tab. 2) Use gotos for unwinding. 3) Some of the extra line breaks for the 80 character limit are no longer needed so we can remove them. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: adc: constify iio_info structuresBhumika Goyal2017-01-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare iio_info structures as const as they are only stored in the info field of a iio_dev structure. This field is of type const, so iio_info structures having similar properties can be made const too. File size before: text data bss dec hex filename 6944 792 0 7736 1e38 drivers/iio/adc/ti-ads1015.o File size after: text data bss dec hex filename 7264 472 0 7736 1e38 drivers/iio/adc/ti-ads1015.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: industrialio-trigger: constify device_type structuresBhumika Goyal2017-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare device_type structure as const as it is only stored in the type field of a device structure. This field is of type const, so add const to declaration of device_type structure. File size before: text data bss dec hex filename 5389 208 48 5645 160d iio/industrialio-trigger.o File size after: text data bss dec hex filename 5453 176 48 5677 162d iio/industrialio-trigger.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: trigger: close race condition in acquiring trigger referenceAlison Schofield2017-01-221-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In iio_trigger_write_current() we find the trigger we want while holding mutex on the list of triggers, but we don't actually do a get on it while holding mutex. We wait until further validations are completed and we're sure it's the one we want. Race condition is that it could be freed by the time we do the get. Solution is to grab the trigger (iio_trigger_get) as soon as we find it while holding mutex on the list of triggers. If later we decide it's not the right one, put it back. (iio_trigger_put). Signed-off-by: Alison Schofield <amsfield22@gmail.com> Suggested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * iio: imu: st_lsm6dsx: fix typo in gyro sensitivity definitionLorenzo Bianconi2017-01-221-3/+3
| | | | | | | | | | Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: add runtime power management supportBrian Masney2017-01-221-8/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds runtime power management support to the isl29028 driver. It defaults to powering off the device after two seconds of inactivity. isl29028_chip_init_and_power_on() currently only zeros the CONFIGURE register on the chip, which will cause the chip to turn off. This patch also renames that function to isl29028_clear_configure_reg() since it is now used in several places. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: only set ALS scale when ALS/IR sensing is enabledBrian Masney2017-01-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | isl29028_chip_init_and_power_on() calls isl29028_set_als_scale() and this is not needed until the user actually needs to take a reading from the ALS/IR sensor. This patch moves the isl29028_set_als_scale() call from isl29028_chip_init_and_power_on() to isl29028_set_als_ir_mode(). This sets the stage for faster resume times from runtime power management if the user is only querying the proximity sensor. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: only set proximity sampling rate when proximity is ↵Brian Masney2017-01-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | enabled isl29028_chip_init_and_power_on() calls isl29028_set_proxim_sampling() and this is not needed until the user actually needs to take a proximity reading. This patch moves the isl29028_set_proxim_sampling() call from isl29028_chip_init_and_power_on() to isl29028_enable_proximity(). This sets the stage for faster resume times from the runtime power management if the user is only querying the ALS/IR sensor. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()Brian Masney2017-01-221-6/+4
| | | | | | | | | | | | | | | | | | isl29028_enable_proximity() has a boolean argument named enable. This function is only called once and the enable flag is set to true in that call. This patch removes the enable parameter from that function. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: remove unnecessary parenthesisBrian Masney2017-01-221-1/+1
| | | | | | | | | | | | | | | | | | isl29028_write_raw() contains unnecessary parenthesis when checking to see if the passed in lux scale is valid. This patch removes the unnecessary parenthesis. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: remove out of memory log messageBrian Masney2017-01-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | If the call to devm_iio_device_alloc() fails, then isl29028_probe() logs a message saying that memory cannot be allocated. The user's system most likely has larger issues at this point. This patch removes that error message since the error code is passed on and the message is not necessary. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: remove unnecessary error logging in ↵Brian Masney2017-01-221-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | isl29028_chip_init_and_power_on() If the call to isl29028_chip_init_and_power_on() in isl29028_probe() fails, then isl29028_probe() will log an error message. All of the error paths in that call path already have error logging in place. This patch removes the unnecessary logging. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: made error messages consistentBrian Masney2017-01-221-24/+32
| | | | | | | | | | | | | | | | | | The wording and style of the different error messages was not consistent. This patch makes the wording and style consistent throughout the driver. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
| * staging: iio: isl29028: move failure logging into isl29028_set_als_scale()Brian Masney2017-01-221-13/+14
| | | | | | | | | | | | | | | | | | | | When isl29028_set_als_scale() fails, it was up to both callers to log the failure message. This patch moves the logging into isl29028_set_als_scale() to reduce the overall amount of code in the driver. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>