summaryrefslogtreecommitdiffstats
path: root/drivers/iio
AgeCommit message (Collapse)AuthorFilesLines
2022-08-21iio: light: cm32181: make cm32181_pm_ops staticsunliming1-1/+1
This symbol is not used outside of cm32181.c, so marks it static. Fixes the following sparse warnings: >> drivers/iio/light/cm32181.c:508:1: sparse: sparse: symbol 'cm32181_pm_ops' was not declared. Should it be static? Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: sunliming <sunliming@kylinos.cn> Link: https://lore.kernel.org/r/20220815012930.150078-1-sunliming@kylinos.cn Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-21iio: ad7292: Prevent regulator double disableMatti Vaittinen1-3/+1
The ad7292 tries to add an devm_action for disabling a regulator at device detach using devm_add_action_or_reset(). The devm_add_action_or_reset() does call the release function should adding action fail. The driver inspects the value returned by devm_add_action_or_reset() and manually calls regulator_disable() if adding the action has failed. This leads to double disable and messes the enable count for regulator. Do not manually call disable if devm_add_action_or_reset() fails. Fixes: 506d2e317a0a ("iio: adc: Add driver support for AD7292") Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Tested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com> Link: https://lore.kernel.org/r/Yv9O+9sxU7gAv3vM@fedora Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-21iio: adc: mcp3911: use correct formula for AD conversionMarcus Folkesson1-5/+12
The ADC conversion is actually not rail-to-rail but with a factor 1.5. Make use of this factor when calculating actual voltage. Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220722130726.7627-4-marcus.folkesson@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-21iio: adc: mcp3911: correct "microchip,device-addr" propertyMarcus Folkesson1-1/+8
Go for the right property name that is documented in the bindings. Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220722130726.7627-3-marcus.folkesson@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-15iio: light: cm3605: Fix an error handling path in cm3605_probe()Christophe JAILLET1-2/+4
The commit in Fixes also introduced a new error handling path which should goto the existing error handling path. Otherwise some resources leak. Fixes: 0d31d91e6145 ("iio: light: cm3605: Make use of the helper function dev_err_probe()") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/0e186de2c125b3e17476ebf9c54eae4a5d66f994.1659854238.git.christophe.jaillet@wanadoo.fr Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-15iio: adc: mcp3911: make use of the sign bitMarcus Folkesson1-0/+2
The device supports negative values as well. Fixes: 3a89b289df5d ("iio: adc: add support for mcp3911") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220722130726.7627-2-marcus.folkesson@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-19iio: light: isl29028: Fix the warning in isl29028_remove()Zheyu Ma1-1/+1
The driver use the non-managed form of the register function in isl29028_remove(). To keep the release order as mirroring the ordering in probe, the driver should use non-managed form in probe, too. The following log reveals it: [ 32.374955] isl29028 0-0010: remove [ 32.376861] general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN PTI [ 32.377676] KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] [ 32.379432] RIP: 0010:kernfs_find_and_get_ns+0x28/0xe0 [ 32.385461] Call Trace: [ 32.385807] sysfs_unmerge_group+0x59/0x110 [ 32.386110] dpm_sysfs_remove+0x58/0xc0 [ 32.386391] device_del+0x296/0xe50 [ 32.386959] cdev_device_del+0x1d/0xd0 [ 32.387231] devm_iio_device_unreg+0x27/0xb0 [ 32.387542] devres_release_group+0x319/0x3d0 [ 32.388162] i2c_device_remove+0x93/0x1f0 Fixes: 2db5054ac28d ("staging: iio: isl29028: add runtime power management support") Signed-off-by: Zheyu Ma <zheyuma97@gmail.com> Link: https://lore.kernel.org/r/20220717004241.2281028-1-zheyuma97@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-19iio: accel: sca3300: Extend the trigger buffer from 16 to 32 bytesLI Qingwu1-11/+19
After added inclination angle channels, the trigger buffer size is insufficient. Extend the buffer size from 16 to 32 bytes, and change the trigger buffer from the struct to a u8 array to adapt the sensor with/without inclination angles output. New trigger buffer data: - SCA3300: 3 accel channels, temp, and timestamp. - SCL3300: 3 accel channels, temp, 3 incli channels, and timestamp. Readjustment the scan index to make it consistent with the buffer data. Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn> Link: https://lore.kernel.org/r/20220701023030.2527019-2-Qing-wu.Li@leica-geosystems.com.cn Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-19iio: fix iio_format_avail_range() printing for none IIO_VAL_INTFawzi Khaber1-1/+17
iio_format_avail_range() should print range as follow [min, step, max], so the function was previously calling iio_format_list() with length = 3, length variable refers to the array size of values not the number of elements. In case of non IIO_VAL_INT values each element has integer part and decimal part. With length = 3 this would cause premature end of loop and result in printing only one element. Signed-off-by: Fawzi Khaber <fawzi.khaber@tdk.com> Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Fixes: eda20ba1e25e ("iio: core: Consolidate iio_format_avail_{list,range}()") Link: https://lore.kernel.org/r/20220718130706.32571-1-jmaneyrol@invensense.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-19iio: adc: max1027: unlock on error path in max1027_read_single_value()Dan Carpenter1-3/+3
If max1027_wait_eoc() fails then call iio_device_release_direct_mode() before returning. Fixes: a0e831653ef9 ("iio: adc: max1027: Introduce an end of conversion helper") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YsbztVuAXnau2cIZ@kili Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-18iio: magnetometer: hmc5843: Remove duplicate 'the'Jiang Jian1-1/+1
Fix an obvious typing error, found by spellcheck(1). Signed-off-by: Jiang Jian <jiangjian@cdjrlc.com> Link: https://lore.kernel.org/r/20220622035925.5008-1-jiangjian@cdjrlc.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-18iio: magn: yas530: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macrosJonathan Cameron1-9/+5
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-37-jic23@kernel.org
2022-07-18iio: magnetometer: ak8974: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macrosJonathan Cameron1-9/+5
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-36-jic23@kernel.org
2022-07-18iio: light: veml6030: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macrosJonathan Cameron1-9/+5
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Rishi Gupta <gupt21@gmail.com> Reviewed-by: Rishi Gupta <gupt21@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-35-jic23@kernel.org
2022-07-18iio: light: vcnl4035: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macrosJonathan Cameron1-9/+5
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Parthiban Nallathambi <pn@denx.de> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-34-jic23@kernel.org
2022-07-18iio: light: vcnl4000: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macrosJonathan Cameron1-9/+5
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Mathieu Othacehe <m.othacehe@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-33-jic23@kernel.org
2022-07-18iio: light: tsl2591: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()Jonathan Cameron1-7/+5
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Joe Sandom <joe.g.sandom@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-32-jic23@kernel.org
2022-07-18iio: light: tsl2583: Use DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()Jonathan Cameron1-8/+5
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the function __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Brian Masney <masneyb@onstation.org> Reviewed-by: Brian Masney <masneyb@onstation.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-31-jic23@kernel.org
2022-07-18iio: light: isl29028: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()Jonathan Cameron1-8/+5
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Brian Masney <masneyb@onstation.org> Reviewed-by: Brian Masney <masneyb@onstation.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-30-jic23@kernel.org
2022-07-18iio: light: gp2ap002: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()Jonathan Cameron1-9/+5
Switching to these newer macros allows use of pm_ptr() to remove the unused functions and structure if !CONFIG_PM without the need to mark anything __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-29-jic23@kernel.org
2022-07-18iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()Jonathan Cameron1-7/+6
Switching to these newer macros allows the compiler to remove the unused functions and struct dev_pm_ops if !CONFIG_PM without the need to mark anything __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Cai Huoqing <cai.huoqing@linux.dev> Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-28-jic23@kernel.org
2022-07-18iio: light: us5182: Switch from CONFIG_PM guards to pm_ptr() etcJonathan Cameron1-5/+3
Letting the compiler remove these functions when the kernel is built without CONFIG_PM support is simpler and less error prone than the use of #ifdef based config guards. Removing instances of this approach from IIO also stops them being copied into new drivers. Very likely it would be safe to use DEFINE_RUNTIME_DEV_PM_OPS() here, but that would be a functional change. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-27-jic23@kernel.org
2022-07-18iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and ↵Jonathan Cameron1-4/+5
pm_sleep_ptr() Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-26-jic23@kernel.org
2022-07-18iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and ↵Jonathan Cameron1-4/+4
pm_sleep_ptr() Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com> Cc: Gwendal Grignou <gwendal@chromium.org> Cc: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-25-jic23@kernel.org
2022-07-18iio: light: cm3605: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-8/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-24-jic23@kernel.org
2022-07-18iio: light: bh1750: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-3/+3
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Tomasz Duszynski <tduszyns@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-23-jic23@kernel.org
2022-07-18iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Christian Eggers <ceggers@arri.de> Reviewed-by: Christian Eggers <ceggers@arri.de> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-22-jic23@kernel.org
2022-07-18iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: David Heidelberg <david@ixit.cz> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-21-jic23@kernel.org
2022-07-18iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: David Heidelberg <david@ixit.cz> Reviewed-by: David Heidelberg <david@ixit.cz> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-20-jic23@kernel.org
2022-07-18iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-19-jic23@kernel.org
2022-07-18iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-18-jic23@kernel.org
2022-07-18iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-17-jic23@kernel.org
2022-07-18iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Philippe Reynes <tremyfr@yahoo.fr> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-16-jic23@kernel.org
2022-07-18iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Philippe Reynes <tremyfr@yahoo.fr> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-15-jic23@kernel.org
2022-07-18iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-14-jic23@kernel.org
2022-07-18iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-13-jic23@kernel.org
2022-07-18iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Ismail H. Kose <ihkose@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-12-jic23@kernel.org
2022-07-18iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Roan van Dijk <roan@protonic.nl> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-11-jic23@kernel.org
2022-07-18iio: adc: xilinx-ams: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-10-jic23@kernel.org
2022-07-18iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-9-jic23@kernel.org
2022-07-18iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-3/+3
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. This one is a little unusual as no suspend callback, but the cleanup is still worthwhile (and eventual aim is to get rid of old macro). Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Philippe Schenker <philippe.schenker@toradex.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-8-jic23@kernel.org
2022-07-18iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-6/+6
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Zhiyong Tao <zhiyong.tao@mediatek.com> Cc: Hui Liu <hui.liu@mediatek.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-7-jic23@kernel.org
2022-07-18iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-5/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-6-jic23@kernel.org
2022-07-18iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-2/+3
In this case we only gain the ability to have the compiler drop the struct dev_pm_ops because the callbacks are called from paths other than suspend and resume. In general the purpose of this new macro is to allow automated removal of the callbacks as well, but that doesn't apply here. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-5-jic23@kernel.org
2022-07-18iio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+5
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Eugen Hristev <eugen.hristev@microchip.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Ludovic Desroches <ludovic.desroches@microchip.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-4-jic23@kernel.org
2022-07-18iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-3-jic23@kernel.org
2022-07-18iio: accel: bma220: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-4/+4
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-2-jic23@kernel.org
2022-07-18iio: adc: ti-ads124s08: Drop unused parameter to ads124s_read()Jonathan Cameron1-3/+3
The channel number is never used in this call, so don't pass it in. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20220626153828.589664-1-jic23@kernel.org
2022-07-18iio: Be consistent with allocation result tests.Joe Simmons-Talbott1-1/+1
Make both allocation result tests use the same format if (!ptr) Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com> Link: https://lore.kernel.org/r/20220718020348.32047-1-joetalbott@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-07-18iio: Use parens with sizeofJoe Simmons-Talbott1-2/+2
Prefer 'sizeof(var)' over 'sizeof var' as reported by checkpatch.pl. Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com> Link: https://lore.kernel.org/r/20220717153438.10800-1-joetalbott@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>