linux/drivers/iio/adc
Luca Ceresoli 9722c3b66e of: remove internal arguments from of_property_for_each_u32()
The of_property_for_each_u32() macro needs five parameters, two of which
are primarily meant as internal variables for the macro itself (in the
for() clause). Yet these two parameters are used by a few drivers, and this
can be considered misuse or at least bad practice.

Now that the kernel uses C11 to build, these two parameters can be avoided
by declaring them internally, thus changing this pattern:

  struct property *prop;
  const __be32 *p;
  u32 val;

  of_property_for_each_u32(np, "xyz", prop, p, val) { ... }

to this:

  u32 val;

  of_property_for_each_u32(np, "xyz", val) { ... }

However two variables cannot be declared in the for clause even with C11,
so declare one struct that contain the two variables we actually need. As
the variables inside this struct are not meant to be used by users of this
macro, give the struct instance the noticeable name "_it" so it is visible
during code reviews, helping to avoid new code to use it directly.

Most usages are trivially converted as they do not use those two
parameters, as expected. The non-trivial cases are:

 - drivers/clk/clk.c, of_clk_get_parent_name(): easily doable anyway
 - drivers/clk/clk-si5351.c, si5351_dt_parse(): this is more complex as the
   checks had to be replicated in a different way, making code more verbose
   and somewhat uglier, but I refrained from a full rework to keep as much
   of the original code untouched having no hardware to test my changes

All the changes have been build tested. The few for which I have the
hardware have been runtime-tested too.

Reviewed-by: Andre Przywara <andre.przywara@arm.com> # drivers/clk/sunxi/clk-simple-gates.c, drivers/clk/sunxi/clk-sun8i-bus-gates.c
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # drivers/gpio/gpio-brcmstb.c
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> # drivers/irqchip/irq-atmel-aic-common.c
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> # drivers/iio/adc/ti_am335x_adc.c
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> # drivers/pwm/pwm-samsung.c
Acked-by: Richard Leitner <richard.leitner@linux.dev> # drivers/usb/misc/usb251xb.c
Acked-by: Mark Brown <broonie@kernel.org> # sound/soc/codecs/arizona.c
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> # sound/soc/codecs/arizona.c
Acked-by: Michael Ellerman <mpe@ellerman.id.au> # arch/powerpc/sysdev/xive/spapr.c
Acked-by: Stephen Boyd <sboyd@kernel.org> # clk
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20240724-of_property_for_each_u32-v3-1-bea82ce429e2@bootlin.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-07-25 06:53:47 -05:00
..
ab8500-gpadc.c iio: adc: ab8500-gpadc: Use device_for_each_child_node_scoped() to simplify erorr paths. 2024-04-06 11:29:06 +01:00
ad799x.c iio: adc: ad799x: Prefer to use octal permission 2024-04-29 20:57:56 +01:00
ad4130.c iio: adc: ad4130: make use of regmap_clear_bits() 2024-06-25 21:04:44 +01:00
ad7091r5.c iio: adc: ad7091r: Add chip_info callback to get conversion result channel 2023-12-26 15:42:24 +00:00
ad7091r8.c iio: adc: ad7091r8: Fix error code in ad7091r8_gpio_setup() 2024-01-22 18:59:07 +00:00
ad7091r-base.c iio: adc: ad7091r-base: Use auto cleanup of locks. 2024-02-17 16:16:11 +00:00
ad7091r-base.h iio: adc: Add support for AD7091R-8 2023-12-26 15:43:33 +00:00
ad7124.c iio: adc: ad_sigma_delta: add disable_one callback 2024-06-25 21:04:32 +01:00
ad7173.c iio: adc: ad7173: Fix uninitialized symbol is_current_chan 2024-07-02 19:43:46 +01:00
ad7192.c iio: adc: ad7192: use devm_regulator_get_enable_read_voltage 2024-06-30 10:38:50 +01:00
ad7266.c IIO: 2nd set of new device support, features and cleanup for 6.11 2024-07-04 11:04:20 +02:00
ad7280a.c iio: adc: ad7280a: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7291.c iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-27 09:48:57 +01:00
ad7292.c iio: adc: ad7292: use devm_regulator_get_enable_read_voltage 2024-06-22 10:51:53 +01:00
ad7298.c iio: adc: ad7298: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7380.c iio: adc: ad7380: add oversampling support 2024-06-04 19:53:08 +01:00
ad7476.c iio: adc: ad7476: simplify using devm_regulator_get_enable() 2022-11-23 19:44:00 +00:00
ad7606_par.c iio: use devm_platform_get_and_ioremap_resource() 2022-11-23 20:41:23 +00:00
ad7606_spi.c
ad7606.c iio: adc: ad7606: using claim_direct_scoped for code simplification 2024-05-27 09:48:55 +01:00
ad7606.h iio: adc: ad7606: simplify using devm_regulator_get_enable() 2022-11-23 19:44:00 +00:00
ad7766.c iio: adc: ad7766: Fix alignment for DMA safety 2022-06-14 11:53:12 +01:00
ad7768-1.c iio: adc: ad7768-1: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
ad7780.c
ad7791.c iio: adc: ad7791: fix IRQ flags 2023-02-18 17:06:09 +00:00
ad7793.c iio: adc: ad7793: use devm_regulator_get_enable_read_voltage 2024-06-22 10:52:13 +01:00
ad7887.c iio: adc: ad7887: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
ad7923.c iio: adc: ad7923: support extended range 2022-09-21 18:42:55 +01:00
ad7944.c iio: adc: ad7944: use devm_spi_optimize_message() 2024-06-30 11:38:13 +01:00
ad7949.c iio: adc: ad7949: Fix error message 2022-07-16 18:50:24 +01:00
ad9467.c Linux 6.10-rc4 2024-06-17 08:31:12 +02:00
ad_sigma_delta.c iio: adc: ad_sigma_delta: add disable_one callback 2024-06-25 21:04:32 +01:00
adi-axi-adc.c iio: adc: adi-axi-adc: improve probe() error messaging 2024-06-22 10:48:48 +01:00
aspeed_adc.c iio: adc: aspeed_adc: use devm_regulator_get_enable_read_voltage() 2024-06-25 21:04:50 +01:00
at91_adc.c iio: adc: at91: Convert to platform remove callback returning void 2023-09-23 15:06:53 +01:00
at91-sama5d2_adc.c iio: adc: at91-sama5d2: Convert to platform remove callback returning void 2023-09-23 15:06:52 +01:00
axp20x_adc.c iio: adc: axp20x_adc: make use of regmap_set_bits() 2024-06-25 21:04:44 +01:00
axp288_adc.c iio: adc: axp288_adc: make use of regmap_set_bits() 2024-06-25 21:04:44 +01:00
bcm_iproc_adc.c iio: adc: bcm_iproc_adc: make use of regmap_clear_bits() 2024-06-25 21:04:44 +01:00
berlin2-adc.c iio: adc: berlin2-adc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:45 +01:00
cc10001_adc.c iio: adc: Explicitly include correct DT includes 2023-07-23 13:38:13 +01:00
cpcap-adc.c iio: adc: cpcap-adc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:44 +01:00
da9150-gpadc.c
dln2-adc.c iio: adc: dln2: Convert to platform remove callback returning void 2023-09-23 15:06:53 +01:00
envelope-detector.c
ep93xx_adc.c iio: adc: ep93xx: Convert to platform remove callback returning void 2023-09-23 15:06:53 +01:00
exynos_adc.c iio: adc: exynos_adc: use 'time_left' variable with wait_for_completion_timeout() 2024-04-29 21:06:18 +01:00
fsl-imx25-gcq.c iio: adc: fsl-imx25-gcq: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:44 +01:00
hi8435.c iio: adc: hi8435: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
hx711.c iio: adc: hx711: use dev_err_probe() 2024-06-25 21:04:51 +01:00
imx7d_adc.c iio: adc: Remove redundant dev_err_probe() 2023-07-29 12:13:17 +01:00
imx8qxp-adc.c IIO: 1st set of new device support, features and cleanup for 6.7 2023-10-20 07:54:15 +02:00
imx93_adc.c iio: adc: imx93: add four channels for imx93 adc 2023-12-04 09:56:28 +00:00
ina2xx-adc.c iio: adc: ina2xx-adc: make use of regmap_clear_bits() 2024-06-25 21:04:45 +01:00
ingenic-adc.c iio: add missing MODULE_DESCRIPTION() macros 2024-06-13 19:19:23 +01:00
intel_mrfld_adc.c iio: adc: intel_mrfld_adc: make use of regmap_clear_bits() 2024-06-25 21:04:45 +01:00
Kconfig iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC 2024-07-01 19:38:48 +01:00
lp8788_adc.c
lpc18xx_adc.c iio: adc: lpc18xx: Benefit from devm_clk_get_enabled() to simplify 2022-08-15 22:30:02 +01:00
lpc32xx_adc.c iio: adc: fix the return value handle for platform_get_irq() 2023-07-29 16:23:45 +01:00
ltc2309.c iio: adc: ltc2309: Fix endian type passed to be16_to_cpu() 2024-06-28 20:04:18 +01:00
ltc2471.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
ltc2485.c iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-27 09:48:57 +01:00
ltc2496.c drivers: iio: adc: ltc2497: Rename the LTC2499 iio device 2022-09-21 18:42:54 +01:00
ltc2497-core.c iio: adc: ltc2947-core: do not use internal iio_dev lock 2022-11-23 19:43:58 +00:00
ltc2497.c iio: adc: ltc2497: Simplify probe() 2023-09-12 10:42:04 +01:00
ltc2497.h iio: adc: ltc2947-core: do not use internal iio_dev lock 2022-11-23 19:43:58 +00:00
Makefile iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC 2024-07-01 19:38:48 +01:00
max1027.c iio: adc: max1027: unlock on error path in max1027_read_single_value() 2022-07-19 09:30:05 +01:00
max1118.c iio: adc: max1118: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
max1241.c iio: adc: max1241: simplify using devm_regulator_get_enable() 2022-11-23 19:44:01 +00:00
max1363.c iio: adc: max1363: use devm_regulator_get_enable_read_voltage() 2024-06-25 21:04:51 +01:00
max9611.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
max11100.c iio: adc: max11100: Fix alignment for DMA safety 2022-06-14 11:53:13 +01:00
max11205.c iio: adc: max11205: simplify with spi_get_device_match_data() 2024-06-13 19:19:24 +01:00
max11410.c iio: adc: max11410: Use device_for_each_child_node_scoped() 2024-03-25 19:50:09 +00:00
max34408.c iio: adc: Add driver support for MAX34408/9 2023-11-16 19:10:25 +00:00
max77541-adc.c iio: adc: max77541: Add ADI MAX77541 ADC Support 2023-06-28 15:18:11 +01:00
mcp320x.c iio: adc: mcp320x: Simplify device removal logic 2024-02-28 19:26:35 +00:00
mcp3422.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
mcp3564.c iio: adc: mcp3564: drop redundant open-coded spi_get_device_match_data() 2024-06-13 19:19:24 +01:00
mcp3911.c iio: adc: mcp3911: simplify code with guard macro 2023-12-10 11:36:38 +00:00
men_z188_adc.c iio: adc: men_z188_adc: Remove redundant initialization owner in men_z188_driver 2023-08-05 17:43:17 +01:00
meson_saradc.c iio: adc: meson_saradc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:45 +01:00
mp2629_adc.c iio: adc: mp2629_adc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:45 +01:00
mt6359-auxadc.c iio: adc: Add support for MediaTek MT6357/8/9 Auxiliary ADC 2024-07-01 19:38:48 +01:00
mt6360-adc.c iio: adc: mt6360: Drop an incorrect __maybe_unused marking. 2022-08-15 22:30:02 +01:00
mt6370-adc.c iio: adc: mt6370: Fix ibus and ibat scaling value of some specific vendor ID chips 2023-05-13 17:54:56 +01:00
mt6577_auxadc.c iio: adc: mt6577_auxadc: Fix kernel panic on suspend 2023-10-11 15:54:40 +01:00
mxs-lradc-adc.c iio: adc: mxs-lradc-adc: don't set masklength 2024-04-29 20:53:24 +01:00
nau7802.c iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-27 09:48:57 +01:00
npcm_adc.c iio: adc: npcm: Convert to platform remove callback returning void 2023-09-23 15:06:54 +01:00
pac1934.c iio: adc: pac1934: remove unused struct 'samp_rate_mapping' 2024-06-04 19:53:06 +01:00
palmas_gpadc.c iio: adc: palmas_gpadc: Drop duplicated the in comment. 2023-09-23 18:38:18 +01:00
qcom-pm8xxx-xoadc.c iio: adc: qcom-pm8xxx-xoadc: drop unused kerneldoc struct pm8xxx_chan_info member 2024-02-28 19:26:38 +00:00
qcom-spmi-adc5.c iio: adc: qcom-spmi-adc5: Use device_for_each_child_node_scoped() 2024-04-13 10:38:05 +01:00
qcom-spmi-iadc.c iio: adc: Explicitly include correct DT includes 2023-07-23 13:38:13 +01:00
qcom-spmi-rradc.c iio: adc: qcom-spmi-rradc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:45 +01:00
qcom-spmi-vadc.c iio: adc: qcom-spmi-vadc: Propagate fw node label to userspace 2023-05-13 18:28:10 +01:00
qcom-vadc-common.c iio: adc: qcom-vadc-common: add reverse scaling for PMIC5 Gen2 ADC_TM 2022-05-19 12:11:51 +02:00
rcar-gyroadc.c iio: adc: rcar-gyroadc: use for_each_available_child_node_scoped() 2024-03-25 19:53:08 +00:00
rn5t618-adc.c iio: adc: rn5t618-adc: make use of regmap_set_bits() 2024-06-25 21:04:45 +01:00
rockchip_saradc.c iio: adc: rockchip_saradc: replace custom logic with devm_reset_control_get_optional_exclusive 2024-02-28 19:26:37 +00:00
rtq6056.c iio: adc: rtq6056: Use automated cleanup for mode handling in write_raw 2024-04-29 20:53:10 +01:00
rzg2l_adc.c iio: adc: rzg2l_adc: Use device_for_each_child_node_scoped() 2024-03-25 19:50:10 +00:00
sc27xx_adc.c iio: adc: sc27xx_adc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:45 +01:00
sd_adc_modulator.c
spear_adc.c iio: adc: spear_adc: Make use of device properties 2024-03-25 20:10:11 +00:00
stm32-adc-core.c iio: Use device_get_match_data() 2023-10-14 17:18:36 +01:00
stm32-adc-core.h iio: adc: stm32-adc: smart calibration support 2022-11-23 20:56:13 +00:00
stm32-adc.c iio: adc: stm32-adc: use 'time_left' variable with wait_for_completion_interruptible_timeout() 2024-04-29 21:06:18 +01:00
stm32-dfsdm-adc.c iio: adc: stm32-dfsdm-adc: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:46 +01:00
stm32-dfsdm-core.c iio: adc: stm32-dfsdm-core: Convert to platform remove callback returning void 2023-09-23 15:06:54 +01:00
stm32-dfsdm.h iio: adc: stm32-dfsdm: add id registers support 2023-01-08 13:11:03 +00:00
stmpe-adc.c iio: adc: Explicitly include correct DT includes 2023-07-23 13:38:13 +01:00
sun4i-gpadc-iio.c iio: adc: sun4i-gpadc-iio: Convert to platform remove callback returning void 2023-09-23 15:06:54 +01:00
sun20i-gpadc-iio.c iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADC 2023-07-20 19:21:29 +01:00
ti_am335x_adc.c of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
ti-adc081c.c iio: adc: ti-adc081c: Simplify probe() 2023-09-12 10:42:04 +01:00
ti-adc084s021.c iio: adc: ti-adc084s021: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc108s102.c iio: adc: ti-adc108s102: use devm_regulator_get_enable_read_voltage() 2024-06-25 21:04:51 +01:00
ti-adc128s052.c iio: adc: ti-adc128s052: Sort headers 2023-01-08 12:12:10 +00:00
ti-adc161s626.c iio: adc: ti-adc161s626: make use of iio_device_claim_direct_scoped() 2024-06-13 19:19:22 +01:00
ti-adc0832.c iio: adc: ti-adc0832: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-adc12138.c iio: adc: ti-adc12138: Fix alignment for DMA safety 2022-06-14 11:53:14 +01:00
ti-ads124s08.c iio: adc: ti-ads124s08: Drop unused parameter to ads124s_read() 2022-07-18 18:43:42 +01:00
ti-ads131e08.c iio: adc: ti-ads131e08: simplify with spi_get_device_match_data() 2024-06-13 19:19:24 +01:00
ti-ads1015.c iio: adc: ti-ads1015: use device_for_each_child_node_scoped() 2024-04-29 21:00:10 +01:00
ti-ads1100.c iio: Switch i2c drivers back to use .probe() 2023-05-21 18:54:53 +01:00
ti-ads1119.c iio: adc: ti-ads1119: Add driver 2024-06-25 21:04:49 +01:00
ti-ads1298.c iio: adc: ti-ads1298: prevent divide by zero in ads1298_set_samp_freq() 2024-02-28 19:26:36 +00:00
ti-ads7924.c iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-27 09:48:57 +01:00
ti-ads7950.c iio: adc: ti-ads7950: Set can_sleep flag for GPIO chip 2023-03-18 16:39:35 +00:00
ti-ads8344.c iio: adc: ti-ads8344: Fix alignment for DMA safety 2022-06-14 11:53:15 +01:00
ti-ads8688.c iio: adc: ti-ads8688: drop ads8688_remove() 2024-06-25 21:04:51 +01:00
ti-lmp92064.c iio: adc: ti-lmp92064: add buffering support 2023-07-20 19:21:30 +01:00
ti-tlc4541.c iio: adc: ti-tlc4541: Fix alignment for DMA safety 2022-06-14 11:53:15 +01:00
ti-tsc2046.c iio: adc: ti-tsc2046: simplify with spi_get_device_match_data() 2024-06-13 19:19:24 +01:00
twl4030-madc.c iio: adc: twl4030-madc: Make use of device properties 2024-03-25 20:10:13 +00:00
twl6030-gpadc.c iio: adc: twl6030-gpadc: use 'time_left' variable with wait_for_completion_interruptible_timeout() 2024-04-29 21:06:18 +01:00
vf610_adc.c iio: adc: vf610_adc: Convert to platform remove callback returning void 2023-09-23 15:06:54 +01:00
viperboard_adc.c
xilinx-ams.c IIO: 2nd set of new device support, features and cleanup for 6.11 2024-07-04 11:04:20 +02:00
xilinx-xadc-core.c iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale 2023-10-13 19:10:39 +01:00
xilinx-xadc-events.c
xilinx-xadc.h iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale 2023-10-13 19:10:39 +01:00