[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67a7d507-7025-ee3e-f388-0a96e11eae41@linaro.org>
Date: Fri, 29 Sep 2023 12:46:27 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: m.majewski2@...sung.com,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-samsung-soc@...r.kernel.org"
<linux-samsung-soc@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
ALIM AKHTAR <alim.akhtar@...sung.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH v2 4/7] thermal: exynos: simplify regulator
(de)initialization
On 26/09/2023 13:02, Mateusz Majewski wrote:
> Hi,
>
>> This is not equivalent. If regulator is provided and enable fails, the
>> old code is nicely returning error. Now, it will print misleading
>> message - failed to get regulator - and continue.
>>
>> While this simplifies the code, it ignores important running condition -
>> having regulator enabled.
>
> Would doing this be correct?
>
> ret = devm_regulator_get_enable_optional(&pdev->dev, "vtmu");
> switch (ret) {
> case 0:
> case -ENODEV:
Not sure to understand why -NODEV is not an error
> break;
> case -EPROBE_DEFER:
> return -EPROBE_DEFER;
> default:
> dev_err(&pdev->dev, "Failed to get enabled regulator: %d\n",
> ret);
> return ret;
> }
ret = devm_regulator_get_enable_optional(&pdev->dev, "vtmu");
if (ret < 0) {
if (ret != EPROBE_DEFER)
dev_err(&pdev->dev, "Failed to get enabled regulator: %d\n", ret);
return ret;
}
??
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists