[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGETcx9+BzSoHj54koiGniUOUPfY9yZ9cAedbb2A-hb+2D1sGw@mail.gmail.com>
Date: Thu, 13 Feb 2025 00:13:13 -0800
From: Saravana Kannan <saravanak@...gle.com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
Cc: Sudeep Holla <sudeep.holla@....com>, Cristian Marussi <cristian.marussi@....com>,
Linus Walleij <linus.walleij@...aro.org>, Dong Aisheng <aisheng.dong@....com>,
Fabio Estevam <festevam@...il.com>, Shawn Guo <shawnguo@...nel.org>, Jacky Bai <ping.bai@....com>,
Pengutronix Kernel Team <kernel@...gutronix.de>, Sascha Hauer <s.hauer@...gutronix.de>, arm-scmi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, imx@...ts.linux.dev, Peng Fan <peng.fan@....com>
Subject: Re: [PATCH v2 3/4] pinctrl: freescale: scmi: Switch to use machine_allowlist
On Sun, Jan 19, 2025 at 11:14 PM Peng Fan (OSS) <peng.fan@....nxp.com> wrote:
>
> From: Peng Fan <peng.fan@....com>
>
> With machine_allowlist, only allowed machines have pinctrl imx scmi
> devices created. The fw_devlink will link consumer and supplier
> correctly.
>
> Signed-off-by: Peng Fan <peng.fan@....com>
> ---
> drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
> index 8f15c4c4dc4412dddb40505699fc3f459fdc0adc..058b4f0477039d57ddae06f385ad809cbb4784d6 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
> @@ -287,11 +287,6 @@ scmi_pinctrl_imx_get_pins(struct scmi_pinctrl_imx *pmx, struct pinctrl_desc *des
> return 0;
> }
>
> -static const char * const scmi_pinctrl_imx_allowlist[] = {
> - "fsl,imx95",
> - NULL
> -};
> -
> static int scmi_pinctrl_imx_probe(struct scmi_device *sdev)
> {
> struct device *dev = &sdev->dev;
> @@ -304,9 +299,6 @@ static int scmi_pinctrl_imx_probe(struct scmi_device *sdev)
> if (!handle)
> return -EINVAL;
>
> - if (!of_machine_compatible_match(scmi_pinctrl_imx_allowlist))
> - return -ENODEV;
> -
> pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph);
> if (IS_ERR(pinctrl_ops))
> return PTR_ERR(pinctrl_ops);
> @@ -339,8 +331,13 @@ static int scmi_pinctrl_imx_probe(struct scmi_device *sdev)
> return pinctrl_enable(pmx->pctldev);
> }
>
> +static const char * const scmi_pinctrl_imx_allowlist[] = {
> + "fsl,imx95",
> + NULL
> +};
> +
> static const struct scmi_device_id scmi_id_table[] = {
> - { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx" },
> + { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx", NULL, scmi_pinctrl_imx_allowlist },
> { }
> };
> MODULE_DEVICE_TABLE(scmi, scmi_id_table);
>
Definite NACK to this. Please don't depend on indirect
conditions/flags. There's no guarantee that this check will hold true
in the future.
-Saravana
Powered by blists - more mailing lists