Commit Graph
6124 Commits
Author SHA1 Message Date
sunliming 0096fc8793 iio: light: cm32181: make cm32181_pm_ops static
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 <[email protected]>
Signed-off-by: sunliming <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-21 18:24:16 +01:00
Matti Vaittinen 22b4277641 iio: ad7292: Prevent regulator double disable
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: 506d2e317a ("iio: adc: Add driver support for AD7292")
Signed-off-by: Matti Vaittinen <[email protected]>
Tested-by: Marcelo Schmitt <[email protected]>
Link: https://lore.kernel.org/r/Yv9O+9sxU7gAv3vM@fedora
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-21 18:24:16 +01:00
Marcus Folkesson 9e2238e3ae iio: adc: mcp3911: use correct formula for AD conversion
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: 3a89b289df ("iio: adc: add support for mcp3911")
Signed-off-by: Marcus Folkesson <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-21 18:24:16 +01:00
Marcus Folkesson cfbd76d5c9 iio: adc: mcp3911: correct "microchip,device-addr" property
Go for the right property name that is documented in the bindings.

Fixes: 3a89b289df ("iio: adc: add support for mcp3911")
Signed-off-by: Marcus Folkesson <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-21 18:24:16 +01:00
Christophe JAILLET 160905549e iio: light: cm3605: Fix an error handling path in cm3605_probe()
The commit in Fixes also introduced a new error handling path which should
goto the existing error handling path.
Otherwise some resources leak.

Fixes: 0d31d91e61 ("iio: light: cm3605: Make use of the helper function dev_err_probe()")
Signed-off-by: Christophe JAILLET <[email protected]>
Link: https://lore.kernel.org/r/0e186de2c125b3e17476ebf9c54eae4a5d66f994.1659854238.git.christophe.jaillet@wanadoo.fr
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-15 22:30:40 +01:00
Marcus Folkesson 8f89e33bf0 iio: adc: mcp3911: make use of the sign bit
The device supports negative values as well.

Fixes: 3a89b289df ("iio: adc: add support for mcp3911")
Signed-off-by: Marcus Folkesson <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
2022-08-15 22:30:40 +01:00
Zheyu Ma 06674fc7c0 iio: light: isl29028: Fix the warning in isl29028_remove()
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: 2db5054ac2 ("staging: iio: isl29028: add runtime power management support")
Signed-off-by: Zheyu Ma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-19 09:42:11 +01:00
LI Qingwu 3cfb0e1d39 iio: accel: sca3300: Extend the trigger buffer from 16 to 32 bytes
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-19 09:38:53 +01:00
Fawzi Khaber 5e1f918503 iio: fix iio_format_avail_range() printing for none IIO_VAL_INT
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 <[email protected]>
Signed-off-by: Jean-Baptiste Maneyrol <[email protected]>
Fixes: eda20ba1e2 ("iio: core: Consolidate iio_format_avail_{list,range}()")
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-19 09:31:27 +01:00
Dan Carpenter 06ee60eb50 iio: adc: max1027: unlock on error path in max1027_read_single_value()
If max1027_wait_eoc() fails then call iio_device_release_direct_mode()
before returning.

Fixes: a0e831653e ("iio: adc: max1027: Introduce an end of conversion helper")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/YsbztVuAXnau2cIZ@kili
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-19 09:30:05 +01:00
Jiang Jian a63d28819f iio: magnetometer: hmc5843: Remove duplicate 'the'
Fix an obvious typing error, found by spellcheck(1).

Signed-off-by: Jiang Jian <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-18 18:53:54 +01:00
Jonathan Cameron e5933cf487 iio: magn: yas530: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron 74f4595ab7 iio: magnetometer: ak8974: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron 1539e05b0b iio: light: veml6030: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
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 <[email protected]>
Cc: Rishi Gupta <[email protected]>
Reviewed-by: Rishi Gupta <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron b904854e14 iio: light: vcnl4035: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
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 <[email protected]>
Cc: Parthiban Nallathambi <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron cd4d10b134 iio: light: vcnl4000: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
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 <[email protected]>
Cc: Mathieu Othacehe <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron 5672f3982a iio: light: tsl2591: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
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 <[email protected]>
Cc: Joe Sandom <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron f541541a37 iio: light: tsl2583: Use DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
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 <[email protected]>
Cc: Brian Masney <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron 9ec91dd4e9 iio: light: isl29028: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
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 <[email protected]>
Cc: Brian Masney <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron 7b79cda9e2 iio: light: gp2ap002: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
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 <[email protected]>
Cc: Linus Walleij <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron 2583f5e828 iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
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 <[email protected]>
Cc: Cai Huoqing <[email protected]>
Reviewed-by: Haibo Chen <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:19 +01:00
Jonathan Cameron a79163d19e iio: light: us5182: Switch from CONFIG_PM guards to pm_ptr() etc
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 <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron fb4e8e2dad iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Nuno Sá <[email protected]>
Reviewed-by: Nuno Sá <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron dc69c61019 iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Enric Balletbo i Serra <[email protected]>
Cc: Gwendal Grignou <[email protected]>
Cc: Stephen Boyd <[email protected]>
Reviewed-by: Gwendal Grignou <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron dc0258e33d iio: light: cm3605: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron 7eff2dcec6 iio: light: bh1750: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Tomasz Duszynski <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron c422aa418a iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Christian Eggers <[email protected]>
Reviewed-by: Christian Eggers <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron f3231f912b iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: David Heidelberg <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron dc064f21ea iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: David Heidelberg <[email protected]>
Reviewed-by: David Heidelberg <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron b220558c0f iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron 3d691c6a9f iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron fa55750642 iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron bf19b23591 iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Philippe Reynes <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron c9ccad9911 iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Philippe Reynes <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron 7b9d3e85d7 iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Marcus Folkesson <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron 83a2aa2646 iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Marcus Folkesson <[email protected]>
Reviewed-by: Marcus Folkesson <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:18 +01:00
Jonathan Cameron 46b7116712 iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Ismail H. Kose <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 479e575aee iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Roan van Dijk <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 3b4a1bd839 iio: adc: xilinx-ams: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Michal Simek <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 0fda2c652d iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Miquel Raynal <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 0b1e58e9ed iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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.  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 <[email protected]>
Cc: Philippe Schenker <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 7ff1d28cc5 iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Zhiyong Tao <[email protected]>
Cc: Hui Liu <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 507379983b iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Martin Blumenstingl <[email protected]>
Acked-by: Martin Blumenstingl <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron cdb7781059 iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
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 <[email protected]>
Cc: Haibo Chen <[email protected]>
Reviewed-by: Haibo Chen <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 45dc8c59e1 iio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Eugen Hristev <[email protected]>
Cc: Nicolas Ferre <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Ludovic Desroches <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 078d37b73f iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 93a73f6a26 iio: accel: bma220: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and 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 <[email protected]>
Reviewed-by: Paul Cercueil <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:48:17 +01:00
Jonathan Cameron 81e2445132 iio: adc: ti-ads124s08: Drop unused parameter to ads124s_read()
The channel number is never used in this call, so don't pass it in.

Signed-off-by: Jonathan Cameron <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
2022-07-18 18:43:42 +01:00
Joe Simmons-Talbott 295cc4268b iio: Be consistent with allocation result tests.
Make both allocation result tests use the same format

    if (!ptr)

Signed-off-by: Joe Simmons-Talbott <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-18 18:29:30 +01:00
Joe Simmons-Talbott ef7ceceeb1 iio: Use parens with sizeof
Prefer 'sizeof(var)' over 'sizeof var' as reported by checkpatch.pl.

Signed-off-by: Joe Simmons-Talbott <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
2022-07-18 18:29:29 +01:00