linux/drivers/clk/qcom
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
..
a7-pll.c clk: qcom: a7-pll: Add missing MODULE_DEVICE_TABLE 2021-04-09 11:20:52 -07:00
a53-pll.c clk: qcom: a53-pll: convert to use parent_data rather than parent_names 2022-09-13 16:49:15 -05:00
apcs-msm8916.c clk: qcom: Convert to platform remove callback returning void 2023-03-13 05:41:06 -07:00
apcs-msm8996.c clk: qcom: apcs-msm8986: Include bitfield.h for FIELD_PREP 2023-02-22 17:38:56 -08:00
apcs-sdx55.c clk: qcom: Convert to platform remove callback returning void 2023-03-13 05:41:06 -07:00
apss-ipq6018.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
apss-ipq-pll.c clk: qcom: apss-ipq-pll: remove 'config_ctl_hi_val' from Stromer pll configs 2024-05-28 16:31:16 -05:00
camcc-sc7180.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sc7280.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sc8280xp.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sdm845.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sm6350.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sm7150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sm8250.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sm8450.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sm8550.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
camcc-sm8650.c soc: dt updates for 6.11 2024-07-16 11:43:51 -07:00
camcc-x1e80100.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
clk-alpha-pll.c This a large collection of clk driver updates and a handful of new SoC 2024-07-19 12:16:28 -07:00
clk-alpha-pll.h clk: qcom: clk-alpha-pll: Add HUAYRA_2290 support 2024-06-12 23:06:52 -05:00
clk-branch.c clk: qcom: branch: Add clk_branch2_prepare_ops 2024-06-12 23:04:26 -05:00
clk-branch.h clk: qcom: branch: Add clk_branch2_prepare_ops 2024-06-12 23:04:26 -05:00
clk-cbf-8996.c interconnect: icc-clk: Specify master/slave ids 2024-07-08 11:40:57 -05:00
clk-cpu-8996.c clk: Annotate struct clk_hw_onecell_data with __counted_by 2023-08-22 13:51:26 -07:00
clk-hfpll.c clk: qcom: clk-hfpll: Configure l_val in init when required 2023-09-13 12:07:58 -07:00
clk-hfpll.h clk: qcom: clk-hfpll: Configure l_val in init when required 2023-09-13 12:07:58 -07:00
clk-krait.c clk: qcom: clk-krait: switch to .determine_rate 2023-03-13 16:38:24 -07:00
clk-krait.h clk: qcom: clk-krait: add apq/ipq8064 errata workaround 2022-06-27 15:41:37 -05:00
clk-pll.c
clk-pll.h
clk-rcg2.c clk: qcom: Park shared RCGs upon registration 2024-07-08 11:31:57 -07:00
clk-rcg.c clk: qcom: clk-rcg: add clk_rcg_floor_ops ops 2022-03-08 16:19:31 -06:00
clk-rcg.h clk: qcom: clk-rcg2: add support for rcg2 freq multi ops 2024-04-27 13:01:14 -05:00
clk-regmap-divider.c
clk-regmap-divider.h
clk-regmap-mux-div.c
clk-regmap-mux-div.h
clk-regmap-mux.c Revert "clk: qcom: regmap-mux: add pipe clk implementation" 2022-05-23 12:26:13 -05:00
clk-regmap-mux.h Revert "clk: qcom: regmap-mux: add pipe clk implementation" 2022-05-23 12:26:13 -05:00
clk-regmap-phy-mux.c clk: qcom: regmap: add PHY clock source implementation 2022-06-25 21:36:07 -05:00
clk-regmap-phy-mux.h clk: qcom: regmap: add PHY clock source implementation 2022-06-25 21:36:07 -05:00
clk-regmap.c clk: qcom: clk-regmap: Provide missing description for 'devm_clk_register_regmap()'s dev param 2021-02-10 19:42:51 -08:00
clk-regmap.h clk: define to_clk_regmap() as inline function 2020-10-28 16:34:44 -07:00
clk-rpm.c clk: qcom: rpm: Remove an unused field in struct rpm_cc 2024-04-20 12:56:58 -05:00
clk-rpmh.c clk: qcom: rpmh: Add support for X1E80100 rpmh clocks 2023-12-07 20:21:13 -08:00
clk-smd-rpm.c clk: qcom: smd-rpm: Restore msm8976 num_clk 2024-04-02 22:49:07 -05:00
clk-spmi-pmic-div.c clk: qcom: clk-spmi-pmic-div: Annotate struct spmi_pmic_div_clk_cc with __counted_by 2023-08-22 13:51:54 -07:00
common.c of: remove internal arguments from of_property_for_each_u32() 2024-07-25 06:53:47 -05:00
common.h clk: qcom: common: Add interconnect clocks support 2024-07-08 11:40:57 -05:00
dispcc-qcm2290.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sc7180.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sc7280.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sc8280xp.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sdm845.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm6115.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm6125.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm6350.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm6375.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm7150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm8250.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm8450.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm8550.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-sm8650.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
dispcc-x1e80100.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
ecpricc-qdu1000.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-apq8084.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
gcc-ipq806x.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
gcc-ipq4019.c Merge branch 'clk-qcom' into clk-next 2023-08-30 14:39:58 -07:00
gcc-ipq5018.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-ipq5332.c clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks 2023-10-21 12:59:13 -07:00
gcc-ipq6018.c clk: qcom: gcc-ipq6018: update sdcc max clock frequency 2024-06-25 23:03:47 -05:00
gcc-ipq8074.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-ipq9574.c This a large collection of clk driver updates and a handful of new SoC 2024-07-19 12:16:28 -07:00
gcc-mdm9607.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-mdm9615.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-msm8660.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
gcc-msm8909.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
gcc-msm8916.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
gcc-msm8917.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-msm8939.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-msm8953.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-msm8960.c clk: Use device_get_match_data() 2023-10-23 20:16:21 -07:00
gcc-msm8974.c clk: Use device_get_match_data() 2023-10-23 20:16:21 -07:00
gcc-msm8976.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-msm8994.c clk: Explicitly include correct DT includes 2023-07-19 13:13:16 -07:00
gcc-msm8996.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-msm8998.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-qcm2290.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-qcs404.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-qdu1000.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sa8775p.c clk: qcom: gcc-sa8775p: Set FORCE_MEM_CORE_ON for gcc_ufs_phy_ice_core_clk 2024-06-23 17:14:04 -05:00
gcc-sc7180.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sc7280.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sc8180x.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sc8280xp.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sdm660.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sdm845.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sdx55.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sdx65.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sdx75.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm4450.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm6115.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm6125.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm6350.c This a large collection of clk driver updates and a handful of new SoC 2024-07-19 12:16:28 -07:00
gcc-sm6375.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm7150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm8150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm8250.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm8350.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm8450.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm8550.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-sm8650.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gcc-x1e80100.c clk: qcom: gcc-x1e80100: Set parent rate for USB3 sec and tert PHY pipe clks 2024-07-08 11:40:17 -05:00
gdsc.c clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode 2024-07-09 12:59:58 +02:00
gdsc.h clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode 2024-07-09 12:59:58 +02:00
gpucc-msm8998.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-qcm2290.c clk: qcom: Add QCM2290 GPU clock controller driver 2024-06-13 18:03:02 -05:00
gpucc-sa8775p.c clk: qcom: gpucc-sa8775p: Update wait_val fields for GPU GDSC's 2024-06-23 17:14:05 -05:00
gpucc-sc7180.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sc7280.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sc8280xp.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sdm660.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sdm845.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm6115.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm6125.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm6350.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm6375.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm8150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm8250.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm8350.c clk: qcom: gpucc-sm8350: Park RCG's clk source at XO during disable 2024-06-23 15:52:56 -05:00
gpucc-sm8450.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm8550.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-sm8650.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
gpucc-x1e80100.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
hfpll.c clk: qcom: hfpll: Add QCS404-specific compatible 2024-04-23 14:14:47 -05:00
Kconfig clk: qcom: ipq9574: Use icc-clk for enabling NoC related clocks 2024-07-08 11:40:57 -05:00
kpss-xcc.c clk: qcom: kpss-xcc: Return of_clk_add_hw_provider to transfer the error 2024-07-06 12:58:02 -05:00
krait-cc.c clk: Use device_get_match_data() 2023-10-23 20:16:21 -07:00
lcc-ipq806x.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
lcc-msm8960.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
lpass-gfm-sm8250.c clk: qcom: add missing MODULE_DESCRIPTION() macros 2024-05-26 22:13:01 -05:00
lpassaudiocc-sc7280.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
lpasscc-sc7280.c clk: qcom: lpasscc-sc7280: fix missing resume during probe 2023-07-18 07:58:50 -07:00
lpasscc-sc8280xp.c clk: qcom: lpasscc-sc8280xp: Constify struct regmap_config 2024-07-06 12:57:13 -05:00
lpasscc-sdm845.c clk: qcom: lpasscc-sdm845: explicitly include clk-provider.h 2021-12-20 23:14:50 -06:00
lpasscorecc-sc7180.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
lpasscorecc-sc7280.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
Makefile Merge branch '20240602114439.1611-1-quic_jkona@quicinc.com' into clk-for-6.11 2024-06-25 21:49:46 -05:00
mmcc-apq8084.c clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays 2024-03-02 12:40:42 -06:00
mmcc-msm8960.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
mmcc-msm8974.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
mmcc-msm8994.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
mmcc-msm8996.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
mmcc-msm8998.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
mmcc-sdm660.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
nsscc-qca8k.c clk: qcom: add clock controller driver for qca8386/qca8084 2024-06-12 23:04:26 -05:00
q6sstop-qcs404.c clk: qcom: q6sstop-qcs404: fix missing resume during probe 2023-07-18 07:58:50 -07:00
reset.c clk: qcom: reset: Ensure write completion on reset de/assertion 2024-02-07 12:14:19 -06:00
reset.h clk: qcom: reset: Increase max reset delay 2024-02-06 14:53:26 -06:00
tcsrcc-sm8550.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
tcsrcc-sm8650.c clk: qcom: add the SM8650 TCSR Clock Controller driver 2023-12-07 08:11:29 -08:00
tcsrcc-x1e80100.c clk: qcom: Add TCSR clock driver for x1e80100 2024-02-06 11:13:19 -06:00
turingcc-qcs404.c clk: qcom: turingcc-qcs404: fix missing resume during probe 2023-07-18 07:58:50 -07:00
videocc-sc7180.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
videocc-sc7280.c This a large collection of clk driver updates and a handful of new SoC 2024-07-19 12:16:28 -07:00
videocc-sdm845.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
videocc-sm7150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
videocc-sm8150.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
videocc-sm8250.c This a large collection of clk driver updates and a handful of new SoC 2024-07-19 12:16:28 -07:00
videocc-sm8350.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
videocc-sm8450.c clk: qcom: common: commonize qcom_cc_really_probe 2024-06-12 23:04:26 -05:00
videocc-sm8550.c Merge branch '20240602114439.1611-1-quic_jkona@quicinc.com' into clk-for-6.11 2024-06-25 21:49:46 -05:00