Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mikhail Kshevetskiy" <mikhail.kshevetskiy@iopsys.eu>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v6 16/17] pinctrl: airoha: try to find chip scu node by phandle first
Date: Sun, 28 Jun 2026 14:54:50 +0000	[thread overview]
Message-ID: <20260628145451.169531F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260628143733.273651-17-mikhail.kshevetskiy@iopsys.eu>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Probe deferral and resource errors from `syscon_regmap_lookup_by_phandle()` are masked by unconditional fallback.
- [Medium] The 'airoha,chip-scu' phandle property is not documented in the device tree binding schemas.
- [Low] Unnecessary and incorrect use of `IS_ERR_OR_NULL()` for an API that exclusively returns valid pointers or `ERR_PTR()`.
--

commit 5fba429358ea0aaa62389e837020f02835843d58
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>

pinctrl: airoha: try to find chip scu node by phandle first

This patch updates the probe routine to search for the chip scu regmap using
the "airoha,chip-scu" phandle before falling back to a SoC-specific compatible
string. This provides better support for newer SoCs while maintaining
compatibility.

> diff --git a/drivers/pinctrl/airoha/pinctrl-airoha.c b/drivers/pinctrl/airoha/pinctrl-airoha.c
> index 543475d23fde3..e24e03b39d3d5 100644
> --- a/drivers/pinctrl/airoha/pinctrl-airoha.c
> +++ b/drivers/pinctrl/airoha/pinctrl-airoha.c
> @@ -683,9 +683,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");

[Severity: Medium]
Is the "airoha,chip-scu" property documented in the device tree binding
schemas? It appears this property might not have been added to the dt-binding
YAML files, which could cause device tree validation tools to emit warnings.

> +	if (IS_ERR_OR_NULL(map)) {

[Severity: Low]
Is IS_ERR_OR_NULL() necessary here? syscon_regmap_lookup_by_phandle() returns
an ERR_PTR() on failure rather than NULL, so IS_ERR() should be sufficient.

[Severity: High]
Does this logic unconditionally overwrite -EPROBE_DEFER if the primary lookup
fails because the syscon node isn't registered yet?

If syscon_regmap_lookup_by_phandle() returns -EPROBE_DEFER or -ENOMEM, the
fallback syscon_regmap_lookup_by_compatible() might fail with -ENODEV and
return that instead. This could cause a permanent driver probe failure rather
than waiting for the resource.

Should the fallback be restricted to only execute if the initial lookup
explicitly returns -ENODEV?

> +		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/20260628143733.273651-1-mikhail.kshevetskiy@iopsys.eu?part=16

  reply	other threads:[~2026-06-28 14:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 14:37 [PATCH v6 00/17] pinctrl: airoha: split on shared and SoC drivers, add more SoCs Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 01/17] dt-bindings: pinctrl: airoha: update/fix device tree binding schemas Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 02/17] pinctrl: airoha: an7581: fix misprint in bitfield name Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 03/17] pinctrl: airoha: an7583: fix I2C0_SDA_PD register bit order Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 04/17] pinctrl: airoha: an7583: there is no mux to enable the second i2c bus Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 05/17] pinctrl: airoha: an7581: fix mux/conf of pcie_reset pins Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 06/17] pinctrl: airoha: an7583: fix muxing of non-gpio default pins Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 07/17] pinctrl: airoha: move common definitions to the separate header Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 08/17] pinctrl: airoha: split driver on shared code and SoC specific drivers Mikhail Kshevetskiy
2026-06-28 14:57   ` sashiko-bot
2026-06-28 14:37 ` [PATCH v6 09/17] pinctrl: airoha: an7581: remove en7581 prefix from variable names Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 10/17] pinctrl: airoha: an7583: remove an7583 prefix from variable names and definitions Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 11/17] pinctrl: airoha: an7583: rename registers to match its an7583 names Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 12/17] pinctrl: airoha: an7583: add support for npu_uart pinmux Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 13/17] pinctrl: airoha: an7583: add support for pon_alt pinmux Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 14/17] pinctrl: airoha: an7583: add support for olt pinmux Mikhail Kshevetskiy
2026-06-28 14:37 ` [PATCH v6 15/17] pinctrl: airoha: add support of en7523 SoC Mikhail Kshevetskiy
2026-06-28 14:57   ` sashiko-bot
2026-06-28 14:37 ` [PATCH v6 16/17] pinctrl: airoha: try to find chip scu node by phandle first Mikhail Kshevetskiy
2026-06-28 14:54   ` sashiko-bot [this message]
2026-06-28 14:37 ` [PATCH v6 17/17] pinctrl: airoha: add support of an7563 SoC Mikhail Kshevetskiy
2026-06-28 14:55   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260628145451.169531F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=mikhail.kshevetskiy@iopsys.eu \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox