[PATCH 4/4] pinctrl: freescale: scmi: Check fwnode instead of machine compatible

Peng Fan (OSS)
2024-12-25T08:27:44Z

From: Peng Fan <peng.fan@nxp.com>

For the platform that not compatible with scmi pinctrl device, the
fwnode will not be set, so checking fwnode will make code simpler
and easy to maintain.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
index 8f15c4c4dc4412dddb40505699fc3f459fdc0adc..5277d30af7084b9bbf83e3523f09c8136d41705b 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,7 +299,7 @@ static int scmi_pinctrl_imx_probe(struct scmi_device *sdev)
if (!handle)
return -EINVAL;

- if (!of_machine_compatible_match(scmi_pinctrl_imx_allowlist))
+ if (!dev->fwnode)
return -ENODEV;

pinctrl_ops = handle->devm_protocol_get(sdev, SCMI_PROTOCOL_PINCTRL, &ph);

--
2.37.1