mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: "André Draszik" <andre.draszik@linaro.org>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>
Cc: Peter Griffin <peter.griffin@linaro.org>,
	Will McVicker <willmcvicker@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH 3/3] firmware: exynos-acpm: convert to dev_err_probe() in client API
Date: Tue, 18 Mar 2025 20:23:44 +0100	[thread overview]
Message-ID: <801a9754-cd57-42c6-9569-16d9a99bfed9@kernel.org> (raw)
In-Reply-To: <20250314-acpm-fixes-v1-3-ab03ca8e723f@linaro.org>

On 14/03/2025 17:40, André Draszik wrote:
> dev_err_probe() exists to simplify code and unify error messages by
> using its message template.
> 
> Convert the remaining dev_err() in acpm_get_by_phandle() to
> dev_err_probe().
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
>  drivers/firmware/samsung/exynos-acpm.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c
> index 48f1e3cacaa709ae703115169df138b659ddae44..03f907a95c6acd66d89cd8af2f52e7c6dadf492a 100644
> --- a/drivers/firmware/samsung/exynos-acpm.c
> +++ b/drivers/firmware/samsung/exynos-acpm.c
> @@ -701,12 +701,14 @@ static const struct acpm_handle *acpm_get_by_phandle(struct device *dev,
>  
>  	link = device_link_add(dev, &pdev->dev, DL_FLAG_AUTOREMOVE_SUPPLIER);
>  	if (!link) {
> -		dev_err(&pdev->dev,
> -			"Failed to create device link to consumer %s.\n",
> -			dev_name(dev));
> +		int ret = -EINVAL;
> +
> +		dev_err_probe(&pdev->dev, ret,
> +			      "Failed to create device link to consumer %s.\n",
> +			      dev_name(dev));

I do not see how it is simpler. Three lines (statement) is now 5 lines
with two statements.

What's more important, dev_err_probe is supposed to be used only in
probe context, while this could be called in other contexts.

Best regards,
Krzysztof

  parent reply	other threads:[~2025-03-18 19:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14 16:40 [PATCH 0/3] firmware: exynos-acpm: read fix & reduce log verbosity André Draszik
2025-03-14 16:40 ` [PATCH 1/3] firmware: exynos-acpm: fix reading longer results André Draszik
2025-03-17 10:23   ` Tudor Ambarus
2025-03-14 16:40 ` [PATCH 2/3] firmware: exynos-acpm: silence EPROBE_DEFER error on boot André Draszik
2025-03-17 10:26   ` Tudor Ambarus
2025-03-17 10:48     ` Tudor Ambarus
2025-03-18 20:48       ` André Draszik
2025-03-14 16:40 ` [PATCH 3/3] firmware: exynos-acpm: convert to dev_err_probe() in client API André Draszik
2025-03-17 11:11   ` Tudor Ambarus
2025-03-18 19:23   ` Krzysztof Kozlowski [this message]
2025-03-18 20:37     ` André Draszik

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=801a9754-cd57-42c6-9569-16d9a99bfed9@kernel.org \
    --to=krzk@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andre.draszik@linaro.org \
    --cc=kernel-team@android.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=willmcvicker@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®