[PATCH] pinctrl: imx: Use of_device_id match table for per-SoC data
Joy Zou
joy.zou at oss.nxp.com
Tue Nov 10 23:15:07 PST 2026
On Mon, Oct 19, 2026 at 08:12:26PM -0300, Fabio Estevam wrote:
> On Mon, Oct 19, 2026 at 8:05 AM <joy.zou at oss.nxp.com> wrote:
>
> > + if (!pmx->data) {
> > + dev_err(pctldev->dev, "platform does not support scmi pinctrl\n");
> > + return -EINVAL;
>
> This NULL check seems redundant as pmx->data has already been NULL
> checked in probe().
Thanks for spotting this.
You're right, pmx->data has already been checked in probe(), so this NULL
check is redundant. I'll drop it in next version.
>
> > + pmx->data = of_machine_get_match_data(scmi_pinctrl_imx_data);
> > + if (!pmx->data)
> > + return -ENODEV;
>
> Can this be NULL? If there is no match, the driver would not be probed.
You're right that it should never return NULL in the normal probe path.
I kept the check as a defensive guard in case the match data table is
modified incorrectly in the future. However, if you think this is
unnecessarily defensive, I can remove it in the next revision.
More information about the linux-arm-kernel
mailing list