From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Viresh Kumar" <viresh.kumar@linaro.org>,
"Nícolas F. R. A. Prado" <nfraprado@collabora.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
kernel@collabora.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] cpufreq: mediatek: Use dev_err_probe in every error path in probe
Date: Tue, 2 Jul 2024 10:26:39 +0200 [thread overview]
Message-ID: <aa6e93bd-aba2-4e4d-bce9-04e818ac25ed@collabora.com> (raw)
In-Reply-To: <20240702055703.obendyy2ykbbutrz@vireshk-i7>
Il 02/07/24 07:57, Viresh Kumar ha scritto:
> 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 ?
>
Logging consistency, that's all; the alternative would be to rewrite the dev_err()
messages to be consistent with what dev_err_probe() says, so that'd be
dev_err("error %pe: (message)");
>> + "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");
>
By the way, forgot to point that out in my former review: to make it shorter,
instead of "ret = -ENOMEM; dev_err_probe()" you can write it as...
ret = dev_err_probe(&pdev->dev, -ENOMEM, ".... message");
Cheers,
Angelo
> Same here.
>
next prev parent reply other threads:[~2024-07-02 8:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 19:48 [PATCH] cpufreq: mediatek: Use dev_err_probe in every error path in probe Nícolas F. R. A. Prado
2024-07-02 5:47 ` AngeloGioacchino Del Regno
2024-07-02 5:57 ` Viresh Kumar
2024-07-02 8:26 ` AngeloGioacchino Del Regno [this message]
2024-07-02 8:43 ` Viresh Kumar
2024-07-03 12:43 ` AngeloGioacchino Del Regno
2024-07-04 3:09 ` Viresh Kumar
2024-07-05 15:13 ` Nícolas F. R. A. Prado
2024-07-08 6:42 ` Viresh Kumar
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=aa6e93bd-aba2-4e4d-bce9-04e818ac25ed@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=nfraprado@collabora.com \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox