[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <893dff7a-2a31-4054-bc93-38544b1d6576@kernel.org>
Date: Tue, 2 Sep 2025 21:24:00 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Yulin Lu <luyulin@...incomputing.com>, linus.walleij@...aro.org,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: ningyu@...incomputing.com, zhengyu@...incomputing.com,
linmin@...incomputing.com, huangyifeng@...incomputing.com,
fenglin@...incomputing.com, lianghujun@...incomputing.com,
Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH] pinctrl: eswin: Fix regulator error check and Kconfig
dependency
On 02/09/2025 11:45, Yulin Lu wrote:
> Smatch reported the following warning in eic7700_pinctrl_probe():
>
> drivers/pinctrl/pinctrl-eic7700.c:638 eic7700_pinctrl_probe()
> warn: passing zero to 'PTR_ERR'
>
> The root cause is that devm_regulator_get() may return NULL when
> CONFIG_REGULATOR is disabled. In such case, IS_ERR_OR_NULL() triggers
> PTR_ERR(NULL) which evaluates to 0, leading to passing a success code
> as an error.
>
> However, this driver cannot work without a regulator. To fix this:
>
> - Change the check from IS_ERR_OR_NULL() to IS_ERR()
> - Update Kconfig to explicitly select REGULATOR and
> REGULATOR_FIXED_VOLTAGE, ensuring that the regulator framework is
> always available.
>
> This resolves the Smatch warning and enforces the correct dependency.
>
> Suggested-by: Dan Carpenter <dan.carpenter@...aro.org>
Wrong tag. Didn't Dan give you proper way to attribute reported? See
submitting-patches. You need Reported-by with Closes.
Best regards,
Krzysztof
Powered by blists - more mailing lists