Re: [PATCH v2] cpufreq: mediatek: Use dev_err_probe in every error path in probe
From: Viresh Kumar
Date: Mon Jul 08 2024 - 02:52:36 EST
On 05-07-24, 11:54, Nícolas F. R. A. Prado wrote:
> Use the dev_err_probe() helper to log the errors on every error path in
> the probe function and its sub-functions. This includes
> * adding error messages where there was none
> * converting over dev_err/dev_warn
> * removing the top-level error message after mtk_cpu_dvfs_info_init() is
> called, since every error path inside that function already logs the
> error reason. This gets rid of the misleading error message when probe
> is deferred:
>
> mtk-cpufreq mtk-cpufreq: failed to initialize dvfs info for cpu0
>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx>
> ---
> Changes in v2:
> - Fixed one occurrence of the error code being set after the usage
> - For the paths that need to set the `ret` variable to the error code,
> changed them so they set it from dev_err_probe()'s return, in a single
> line.
> - Link to v1: https://lore.kernel.org/r/20240628-mtk-cpufreq-dvfs-fail-init-err-v1-1-19c55db23011@xxxxxxxxxxxxx
> ---
> drivers/cpufreq/mediatek-cpufreq.c | 72 ++++++++++++++++++--------------------
> 1 file changed, 34 insertions(+), 38 deletions(-)
Applied. Thanks.
--
viresh