[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240703-of_property_for_each_u32-v1-0-42c1fc0b82aa@bootlin.com>
Date: Wed, 03 Jul 2024 12:36:44 +0200
From: Luca Ceresoli <luca.ceresoli@...tlin.com>
To: Miguel Ojeda <ojeda@...nel.org>, Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>,
Nathan Chancellor <nathan@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Tony Lindgren <tony@...mide.com>,
Bjorn Andersson <andersson@...nel.org>,
Emilio López <emilio@...pez.com.ar>,
Chen-Yu Tsai <wens@...e.org>, Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>, Krzysztof Kozlowski <krzk@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Jonathan Cameron <jic23@...nel.org>,
Lee Jones <lee@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Uwe Kleine-König <ukleinek@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Richard Leitner <richard.leitner@...ux.dev>,
Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Damien Le Moal <dlemoal@...nel.org>
Cc: "Peng Fan (OSS)" <peng.fan@....nxp.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
llvm@...ts.linux.dev, linux-clk@...r.kernel.org, linux-omap@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, linux-samsung-soc@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-iio@...r.kernel.org,
linux-pwm@...r.kernel.org, linux-serial@...r.kernel.org,
linux-usb@...r.kernel.org, patches@...nsource.cirrus.com,
linux-sound@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org, Luca Ceresoli <luca.ceresoli@...tlin.com>
Subject: [PATCH 00/20] Simplify of_property_for_each_u32()
[Note: to reduce the noise I have trimmed the get_maintainers list
manually. Should you want to be removed, or someone else added, to future
versions, just tell me. Sorry for the noise.]
This series aims at simplifying of_property_for_each_u32() as well as
making it more difficult to misuse it in the future.
The long-term goal is 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) { ... }
So, removing the 3rd and 4th arguments which are typically meant to be
internal. Those two parameters used to be unavoidable until the kernel
moved to building with the C11 standard unconditionally. Since then, it is
now possible to get rid of them. However a few users of
of_property_for_each_u32() do actually use those arguments, which
complicates the transition. For this reason this series does the following:
* Add of_property_for_each_u32_new(), which does not have those two
arguments (patch 1)
* Convert _almost_ every usage to of_property_for_each_u32_new()
* Rename of_property_for_each_u32() to of_property_for_each_u32_old() and
deprecate it, as a incentive to code not (yet) in mainline to upgrade
to the *_new() version (last patch)
The plan for the next series is to additionally:
* Convert the few remaining of_property_for_each_u32_old() instantes to
of_property_for_each_u32_new()
* Remove of_property_for_each_u32_old()
* Rename of_property_for_each_u32_new() to of_property_for_each_u32()
Signed-off-by: Luca Ceresoli <luca.ceresoli@...tlin.com>
---
Luca Ceresoli (20):
of: add of_property_for_each_u32_new()
clk: convert to of_property_for_each_u32_new()
clk: qcom: convert to of_property_for_each_u32_new()
clk: sunxi: clk-simple-gates: convert to of_property_for_each_u32_new()
clk: sunxi: clk-sun8i-bus-gates: convert to of_property_for_each_u32_new()
clocksource/drivers/samsung_pwm: convert to of_property_for_each_u32_new()
bus: ti-sysc: convert to of_property_for_each_u32_new()
lk: clk-conf: convert to of_property_for_each_u32_new()
gpio: brcmstb: convert to of_property_for_each_u32_new()
pinctrl: s32cc: convert to of_property_for_each_u32_new()
irqchip/atmel-aic: convert to of_property_for_each_u32_new()
iio: adc: ti_am335x_adc: convert to of_property_for_each_u32_new()
pwm: samsung: convert to of_property_for_each_u32_new()
tty: sysrq: convert to of_property_for_each_u32_new()
usb: usb251xb: convert to of_property_for_each_u32_new()
mfd: ti_am335x_tscadc: convert to of_property_for_each_u32_new()
ASoC: arizona: convert to of_property_for_each_u32_new()
powerpc/xive: convert to of_property_for_each_u32_new()
powerpc/xive: convert to of_property_for_each_u32_new()
of: deprecate and rename of_property_for_each_u32()
.clang-format | 3 ++-
arch/powerpc/sysdev/xive/native.c | 4 +---
arch/powerpc/sysdev/xive/spapr.c | 3 +--
drivers/bus/ti-sysc.c | 4 +---
drivers/clk/clk-conf.c | 4 +---
drivers/clk/clk-si5351.c | 4 ++--
drivers/clk/clk.c | 6 ++----
drivers/clk/qcom/common.c | 4 +---
drivers/clk/sunxi/clk-simple-gates.c | 4 +---
drivers/clk/sunxi/clk-sun8i-bus-gates.c | 4 +---
drivers/clocksource/samsung_pwm_timer.c | 4 +---
drivers/gpio/gpio-brcmstb.c | 5 +----
drivers/iio/adc/ti_am335x_adc.c | 4 +---
drivers/irqchip/irq-atmel-aic-common.c | 4 +---
drivers/irqchip/irq-pic32-evic.c | 2 +-
drivers/mfd/ti_am335x_tscadc.c | 4 +---
drivers/pinctrl/nxp/pinctrl-s32cc.c | 4 +---
drivers/pinctrl/pinctrl-k210.c | 2 +-
drivers/pwm/pwm-samsung.c | 4 +---
drivers/tty/sysrq.c | 4 +---
drivers/usb/misc/usb251xb.c | 4 +---
include/linux/of.h | 14 ++++++++++----
sound/soc/codecs/arizona.c | 12 +++++-------
23 files changed, 39 insertions(+), 68 deletions(-)
---
base-commit: e937d48ed96381e9620d9c81fbc1ce666f5b7358
change-id: 20240701-of_property_for_each_u32-460fd02a5d0c
Best regards,
--
Luca Ceresoli <luca.ceresoli@...tlin.com>
Powered by blists - more mailing lists