[PATCH] pinctrl: imx: Use of_device_id match table for per-SoC data
Linus Walleij
linusw at kernel.org
Wed Nov 4 04:54:28 PST 2026
On Mon, Oct 19, 2026 at 1:05 PM <joy.zou at oss.nxp.com> wrote:
> From: Peng Fan <peng.fan at nxp.com>
>
> Replace the hardcoded of_machine_is_compatible() if-else chain and the
> static string allowlist with a proper of_device_id match table carrying
> per-SoC data via the .data field.
>
> This eliminates the static local variable anti-pattern for daisy_off
> (lazy-initialized, shared across instances) and adopts the idiomatic
> kernel of_machine_get_match_data() APIs.
>
> A new pinctrl_scmi_imx_data struct captures the daisy register offset
> for future extensibility when new SoCs may not use register-offset based
> daisy configuration.
>
> No functional changes.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> Signed-off-by: Joy Zou <joy.zou at nxp.com>
> ---
> Replace the hardcoded of_machine_is_compatible() if-else chain and the
> static string allowlist with an of_device_id match table that carries the
> per-SoC daisy register offset in its .data field.
>
> This drops the lazily-initialized "static uint32_t daisy_off" local and
> lets probe do the compatible match and per-SoC data lookup in one step
> via of_machine_get_match_data().
>
> No functional change intended.
>
> Signed-off-by: Joy Zou <joy.zou at oss.nxp.com>
I don't know if this is the latest version of the patch... if it is,
look into Fabio's review comment, rebase on v7.4-rc1 and resend,
thanks!
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list