summaryrefslogtreecommitdiff
path: root/drivers/iio
AgeCommit message (Collapse)AuthorFilesLines
2026-03-01iio: dac: mcp47feb02: Fix mutex used before initializationFelix Gu1-2/+0
The mcp47feb02_parse_fw() function uses data->lock, but the mutex was initialized after this function in probe path. Since mcp47feb02_parse_fw() is only called from probe(), remove the lock. Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01iio: adc: ade9000: fix wrong return type in streaming pushGiorgi Tchankvetadze1-1/+1
The else branch of ade9000_iio_push_streaming() incorrectly returns IRQ_HANDLED on regmap_write failure. This function returns int (0 on success, negative errno on failure), so IRQ_HANDLED (1) would be misinterpreted as a non-error by callers. Return ret instead, consistent with every other error path in the function. Fixes: 81de7b4619fc ("iio: adc: add ade9000 support") Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Reviewed-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01iio: adc: ade9000: fix wrong register in CALIBBIAS case for active powerGiorgi Tchankvetadze1-1/+1
The switch statement in ade9000_write_raw() attempts to match chan->address against ADE9000_REG_AWATTOS (0x00F) to dispatch the calibration offset write for active power channels. However, chan->address is set via ADE9000_ADDR_ADJUST(ADE9000_REG_AWATT, num), so after masking the phase bits, tmp holds ADE9000_REG_AWATT (0x210), which never matches 0x00F. As a result, writing IIO_CHAN_INFO_CALIBBIAS for IIO_POWER always falls through to the default case and returns -EINVAL, making active power offset calibration silently broken. Fix this by matching against ADE9000_REG_AWATT instead, which is the actual base address stored in chan->address for watt channels. Reference:ADE9000 datasheet (Rev. B), AWATTOS is the offset correction register at 0x00F (p. 44), while AWATT is the total active power register at 0x210 (p. 48). Fixes: 81de7b4619fc ("iio: adc: add ade9000 support") Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Reviewed-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01iio: accel: adxl380: fix FIFO watermark bit 8 always written as 0Antoniu Miclaus1-1/+1
FIELD_PREP(BIT(0), fifo_samples & BIT(8)) produces either 0 or 256, and since FIELD_PREP masks to bit 0, 256 & 1 evaluates to 0. Use !! to convert the result to a proper 0-or-1 value. Fixes: df36de13677a ("iio: accel: add ADXL380 driver") Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01iio: adc: ade9000: move mutex init before IRQ registrationAntoniu Miclaus1-4/+4
Move devm_mutex_init() before ade9000_request_irq() calls so that st->lock is initialized before any handler that depends on it can run. Fixes: 81de7b4619fc ("iio: adc: add ade9000 support") Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01iio: pressure: abp2030pa: Remove IRQF_ONESHOT from devm_request_irq()Felix Gu1-1/+1
Since commit aef30c8d569c ("genirq: Warn about using IRQF_ONESHOT without a threaded handler"), the IRQ core checks IRQF_ONESHOT flag in IRQ request and gives a warning if there is no threaded handler. Remove IRQF_ONESHOT from devm_request_irq(). Fixes: 47d323ce1e89 ("iio: pressure: add Honeywell ABP2 driver") Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felix Gu <ustc.gu@gmail.com> Tested-by: Petre Rodan <petre.rodan@subdimension.ro> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-03-01iio: adc: ti-ads1119: Fix unbalanced pm reference count in ↵Felix Gu1-1/+1
ds1119_single_conversion() In ads1119_single_conversion(), if pm_runtime_resume_and_get() fails, the code jumps to the pdown label, which calls pm_runtime_put_autosuspend(). Since pm_runtime_resume_and_get() automatically decrements the usage counter on failure, the subsequent call to pm_runtime_put_autosuspend() causes an unbalanced reference counter. Fixes: a9306887eba4 ("iio: adc: ti-ads1119: Add driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Reviewed-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: ad9523: use octal permissionsBhargav Joshi1-49/+29
The driver currently defines device attributes using symbolic permission flags (S_IRUGO and S_IWUSR). Update these to use octal permissions (0444 and 0200) to resolve checkpatch warnings. Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: ad9523: fix multi-line dereferencesBhargav Joshi1-4/+2
Platform data pointer dereferences for pll1_charge_pump_current_nA and pll2_charge_pump_current_nA were split across multiple lines. Bring the dereference chains onto a single line. This resolves the following checkpatch.pl warnings: WARNING: Avoid multiple line dereference - prefer 'pdata->pll1_charge_pump_current_nA' WARNING: Avoid multiple line dereference - prefer 'pdata->pll2_charge_pump_current_nA' Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: ad9523: fix implicit variable macrosBhargav Joshi1-2/+2
The macros AD9523_CLK_DIST_DIV_PHASE_REV(x) and AD9523_CLK_DIST_DIV_REV(x) implicitly relied on the variable named 'ret' instead of using passed argument '(x)'. Update the macros to explicitly use the argument '(x)' for their operations. This also resolves the following checkpatch.pl warning: Argument '(x)' is not used in function-like macro. Signed-off-by: Bhargav Joshi <rougueprince47@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: adc: ade9000: remove unused AD9000_CHANNELS_PER_PHASE macroGiorgi Tchankvetadze1-1/+0
Remove the AD9000_CHANNELS_PER_PHASE macro which is unused, has a misspelled prefix (AD9000 instead of ADE9000), and has an incorrect value (10 instead of 11, there are 33 total channels and 3 phases, so 11 per phase). Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: filter: admv8818: use dev_err_probe()Antoniu Miclaus1-21/+14
Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: filter: admv8818: add dev variableAntoniu Miclaus1-10/+11
Introduce a local struct device pointer in functions that reference &spi->dev for device-managed resource calls and device property reads, improving code readability. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: dac: ad7293: use dev_err_probe()Antoniu Miclaus1-5/+3
Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: dac: ad7293: add dev variableAntoniu Miclaus1-11/+12
Introduce a local struct device pointer in functions that reference &spi->dev for device-managed resource calls and device property reads, improving code readability. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: adf4377: use dev_err_probe()Antoniu Miclaus1-17/+12
Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: adf4377: add dev variableAntoniu Miclaus1-13/+14
Introduce a local struct device pointer in functions that reference &spi->dev for device-managed resource calls and device property reads, improving code readability. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: admv1013: use dev_err_probe()Antoniu Miclaus1-9/+5
Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: admv1013: add dev variableAntoniu Miclaus1-14/+15
Introduce a local struct device pointer in functions that reference &spi->dev for device-managed resource calls and device property reads, improving code readability. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: admv1014: use dev_err_probe()Antoniu Miclaus1-36/+24
Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: admv1014: add dev variableAntoniu Miclaus1-13/+16
Introduce a local struct device pointer in functions that reference &spi->dev for device-managed resource calls and device property reads, improving code readability. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: adrf6780: use dev_err_probe()Antoniu Miclaus1-14/+11
Use dev_err_probe() consistently in the probe path to simplify error handling and ensure deferred probes are logged correctly. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-28iio: frequency: adrf6780: add dev variableAntoniu Miclaus1-17/+18
Introduce a local struct device pointer in functions that reference &spi->dev for device-managed resource calls and device property reads, improving code readability. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-27i3c: simplify combined i3c/i2c dependenciesArnd Bergmann1-2/+1
All combined i2c/i3c drivers appear to suffer from the same link time problem when CONFIG_I3C is set to 'm': arm-linux-gnueabi-ld: drivers/iio/magnetometer/mmc5633.o: in function `mmc5633_i3c_driver_init': mmc5633.c:(.init.text+0x30): undefined reference to `i3c_driver_register_with_owner' This was previously fixed every time by marking individual drivers as 'depends on I2C; depends on I3C || !I3C', but this gets tedious and is somewhat confusing. Add a Kconfig symbol 'I3C_OR_I2C' to help replace those dependencies, and use this in all the existing drivers that had already fixed it as well as the new mmc5633 driver. Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jonathan Cameron <jonathan.cameron@huawei.com> Link: https://patch.msgid.link/20260204164216.544409-1-arnd@kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2026-02-24iio: addac: ad74413r: simplify timeout returnAntoniu Miclaus1-6/+3
Return -ETIMEDOUT directly instead of assigning it to an intermediate variable first. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: adc: ad7173: move opening brace to a separate lineGiorgi Tchankvetadze1-1/+2
Place the opening brace of ad7173_calc_openwire_thrsh_raw() on its own line to comply with the kernel coding style for function definitions. Issue found by checkpatch. Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Join some lines of code to be a single lineAndy Shevchenko1-26/+13
In some cases the wrapped lines are harder to follow. Join them despite being longer than 80 characters in some cases. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Remove trailing comma in termination entryAndy Shevchenko1-1/+1
Termination entry by definition should be the last one, hence remove stray comma after it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Explicitly use string literal for driver nameAndy Shevchenko1-6/+2
The driver name should be easily greppable and clearly spelled. Replace a level of indirection and explicitly use string literal. While at it, remove useless blank lines before module_*() and MODULE_*() macros. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Use temporary variable for struct deviceAndy Shevchenko1-18/+16
Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Replace custom implementation of min()Andy Shevchenko1-3/+3
Replace custom implementation of min() to save a few lines of code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Fix possible error swallowEthan Tidmore1-8/+12
Move error check into for loop in gp2ap020a00f_buffer_postenable() and gp2ap020a00f_buffer_predisable(), this fixes a possible error swallow. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Return directly from the switch casesAndy Shevchenko1-36/+24
Return directly from the switch cases which makes code easier to follow. In some cases convert pieces to the standard pattern which also unifies it with the accepted kernel practices. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: Use correct types for 16-bit LE dataAndy Shevchenko1-12/+11
Instead of using byte arrays and then explicit castings, change the types of byte arrays to be __le16 and update the endianness conversions accordingly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: correct return type to intEthan Tidmore1-4/+9
The function gp2ap020a00f_get_thresh_reg() can return -EINVAL in its error path. Yet, the function has return type of u8. Added error checking for gp2ap020a00f_get_thresh_reg() return value. Detected by Smatch: drivers/iio/light/gp2ap020a00f.c:1013 gp2ap020a00f_get_thresh_reg() warn: signedness bug returning '(-22)' Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: light: gp2ap020a00f: simplify locking with guard()Ethan Tidmore1-75/+35
Use the guard() cleanup handler to manage the device lock. This simplifies the code by removing the need for manual unlocking and goto error handling paths. Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24Merge branch 'ib-iio-thermal-qcom-pmic5' into togregJonathan Cameron3-0/+887
Immutable branch to allow this base work to be merged into thermal.
2026-02-24iio: adc: at91_adc: change at91_ts_sample to return voidAntoniu Miclaus1-5/+3
The return value of at91_ts_sample() is never checked by its caller. Change the return type to void to make this explicit. The error conditions are already logged via dev_err() which provides sufficient visibility into hardware issues. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: update device supportRodrigo Alencar2-1/+89
Add support for the following digital step attenuators: - HMC271A: 1dB LSB 5-Bit Digital Attenuator SMT, 0.7 - 3.7 GHz - ADRF5720: 0.5 dB LSB, 6-Bit, Digital Attenuator, 9 kHz to 40 GHz - ADRF5730: 0.5 dB LSB, 6-Bit, Digital Attenuator, 100 MHz to 40 GHz - ADRF5731: 2 dB LSB, 4-Bit, Digital Attenuator, 100 MHz to 40 GHz - HMC1018A: 1.0 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz - HMC1019A: 0.5 dB LSB GaAs MMIC 5-BIT DIGITAL ATTENUATOR, 0.1 - 30 GHz Additionally, copyright notice was updated with current year. Co-developed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Co-developed-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: consume enable gpioRodrigo Alencar1-0/+6
Some parts may consume enable GPIO to enable serial mode (HMC1119's and HMC792A P/S pin) or powerup the device (e.g. ADA4961's PWUP pin). Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: add device tree supportRodrigo Alencar1-48/+59
Drop the enum ID, split chip info table into per-device structs and add of_match_table. Additionally, add 'name' field into the chip info struct, dropping the usage of spi_get_device_id(). Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: prepare for device-tree supportRodrigo Alencar1-90/+44
Drop switch case on the enum ID in favor of extended chip info table, containing: - gain_step, indicating with sign the start of the code range; - num_channels, to indicate the number IIO channels; - pack_code() function to describe how SPI buffer is populated; Which allowed for a simplified read_raw() and write_raw() callbacks. The probe() function was adjusted accordingly. The linux/array_size.h include is removed as number of channels is provided by chip info table. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: replace reset-gpio with reset controllerRodrigo Alencar1-6/+7
Remove reset_gpio from the device state struct and use the reset_control interface instead, using a local variable, as it is not being used anywhere else. The reset controller init is moved out from the switch case and optionally initialized for every device variant. Although not all devices have a reset pin the code does not need to change if it is not wired. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: refactor device resource managementRodrigo Alencar1-40/+10
Adhere modern device resource management with the following: - Voltage regulator managed and enabled internally; - IIO device registration handled with devm_iio_device_register(); - removal of goto's from the probe function; - ad8366_remove() removed as it is not needed anymore; With the drop of goto's dev_err_probe() is used to report probe errors. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: use devm_mutex_init() and drop mutex_init()Rodrigo Alencar1-1/+4
Adopt proper mutex lifecycle with devm_mutex_init(), replacing mutex_init(). Mutex init is moved up (before regulator init), so that goto statement in the error path is avoided (which will be cleaned up later). Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: add local dev pointer to the probe functionRodrigo Alencar1-1/+2
Create local device pointer in the probe function to shorten lines, making the code easier to read. The local device pointer replaces &spi->dev and will be reused across other probe function places in later patches. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: amplifiers: ad8366: refactor include headersRodrigo Alencar1-9/+12
Apply IWYU principle, removing the following headers: - linux/device.h: no usage of devm_add_action_or_reset, device_attr... - linux/kernel.h: no usage of container_of, kasprintf, ... - linux/slab.h: memory management handled by iio - linux/sysfs.h: sysfs interaction is managed by iio - linux/iio/sysfs.h: not using iio device attributes in this driver Adding the following missing headers: + linux/array_size.h: for ARRAY_SIZE + linux/bits.h: for BIT + linux/dev_printk.h: for dev_err + linux/math.h: for abs + linux/mutex.h: for mutex_lock, mutex_unlock + linux/mod_devicetable.h: for spi_device_id + linux/types.h for NULL, __aligned Additionally, those include directives are alphabetically sorted. Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: adc: ade9000: use dev_err_probe() in probe pathAntoniu Miclaus1-4/+3
Replace dev_err() + return with dev_err_probe() in ade9000_reset(), which is called during probe. This simplifies error handling. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-24iio: core: Simplify IIO core managed APIsAndy Shevchenko2-44/+21
Use devm_add_action_or_reset() instead of devres_alloc() and devres_add(), which works the same. This will simplify the code. There is no functional changes. While at it, inline devm_iio_kfifo_allocate() into its only user. Reviewed-by: Nuno Sá <nuno.sa@analog.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2026-02-23iio: adc: ad7266: simplify error returnAntoniu Miclaus1-4/+2
Return PTR_ERR() directly instead of assigning it to an intermediate variable first. Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>