Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The fallback logic for chip SCU regmap lookup masks `-EPROBE_DEFER` and other legitimate errors from `syscon_regmap_lookup_by_phandle()`.
--
--- Patch [33]: [PATCH v9 33/36] pinctrl: airoha: try to find chip scu node by phandle first ---
commit 61237bb0bf7e8867822c8f795d7f2be68c677edc
Author: Mikhail Kshevetskiy <[email protected]>
pinctrl: airoha: try to find chip scu node by phandle first
The patch updates the airoha pinctrl driver to first search for the chip
SCU regmap using the "airoha,chip-scu" phandle. If that fails, it falls
back to using the SoC-specific compatible string.
> diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
> index 5a9afea4bb960..f6acbfdd0911f 100644
> --- a/drivers/pinctrl/airoha/pinctrl-airoha.c
> +++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
[ ... ]
> @@ -781,9 +781,12 @@ int airoha_pinctrl_probe(struct platform_device *pdev)
> if (IS_ERR(pinctrl->regmap))
> return PTR_ERR(pinctrl->regmap);
>
> - map = syscon_regmap_lookup_by_compatible("airoha,en7581-chip-scu");
> - if (IS_ERR(map))
> - return PTR_ERR(map);
> + map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "airoha,chip-scu");
> + if (IS_ERR_OR_NULL(map)) {
[Severity: High]
Does this fallback logic inadvertently mask legitimate errors like -EPROBE_DEFER
from syscon_regmap_lookup_by_phandle()?
If the initial phandle lookup returns -EPROBE_DEFER (for instance, if the
syscon node exists but hasn't probed yet), IS_ERR_OR_NULL(map) will catch it
and execute the fallback to syscon_regmap_lookup_by_compatible().
If the legacy compatible string is then missing from the modern device tree,
the fallback will return -ENODEV. This overwrites the original -EPROBE_DEFER
error, causing the driver probe to permanently fail instead of correctly
deferring.
> + map = syscon_regmap_lookup_by_compatible(data->chip_scu_compatible);
> + if (IS_ERR(map))
> + return PTR_ERR(map);
> + }
>
> pinctrl->chip_scu = map;
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=33
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.