From: Krzysztof Kozlowski <krzk@kernel.org>
To: Yulin Lu <luyulin@eswincomputing.com>,
linus.walleij@linaro.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: ningyu@eswincomputing.com, zhengyu@eswincomputing.com,
linmin@eswincomputing.com, huangyifeng@eswincomputing.com,
fenglin@eswincomputing.com, lianghujun@eswincomputing.com,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH] pinctrl: eswin: Fix regulator error check and Kconfig dependency
Date: Tue, 2 Sep 2025 21:24:00 +0200 [thread overview]
Message-ID: <893dff7a-2a31-4054-bc93-38544b1d6576@kernel.org> (raw)
In-Reply-To: <20250902094508.288-1-luyulin@eswincomputing.com>
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@linaro.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
prev parent reply other threads:[~2025-09-02 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 9:45 [PATCH] pinctrl: eswin: Fix regulator error check and Kconfig dependency Yulin Lu
2025-09-02 19:24 ` Krzysztof Kozlowski [this message]
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=893dff7a-2a31-4054-bc93-38544b1d6576@kernel.org \
--to=krzk@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=fenglin@eswincomputing.com \
--cc=huangyifeng@eswincomputing.com \
--cc=lianghujun@eswincomputing.com \
--cc=linmin@eswincomputing.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luyulin@eswincomputing.com \
--cc=ningyu@eswincomputing.com \
--cc=zhengyu@eswincomputing.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.