[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240702055703.obendyy2ykbbutrz@vireshk-i7>
Date: Tue, 2 Jul 2024 11:27:03 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: NĂcolas F. R. A. Prado <nfraprado@...labora.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
kernel@...labora.com, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] cpufreq: mediatek: Use dev_err_probe in every error path
in probe
On 28-06-24, 15:48, NĂcolas F. R. A. Prado wrote:
> diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
> @@ -629,11 +630,9 @@ static int mtk_cpufreq_probe(struct platform_device *pdev)
> int cpu, ret;
>
> data = dev_get_platdata(&pdev->dev);
> - if (!data) {
> - dev_err(&pdev->dev,
> - "failed to get mtk cpufreq platform data\n");
> - return -ENODEV;
> - }
> + if (!data)
> + return dev_err_probe(&pdev->dev, -ENODEV,
What's the point of calling dev_err_probe() when we know for sure that
the error isn't EPROBE_DEFER ?
> + "failed to get mtk cpufreq platform data\n");
>
> for_each_possible_cpu(cpu) {
> info = mtk_cpu_dvfs_info_lookup(cpu);
> @@ -643,24 +642,21 @@ static int mtk_cpufreq_probe(struct platform_device *pdev)
> info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
> if (!info) {
> ret = -ENOMEM;
> + dev_err_probe(&pdev->dev, ret, "Failed to allocate dvfs_info\n");
Same here.
--
viresh
Powered by blists - more mailing lists