From: Krzysztof Kozlowski <krzk@kernel.org>
To: Yang Ruibin <11162571@vivo.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH v1] rtc: rtc-asm9260: Switch to use dev_err_probe()
Date: Wed, 28 Aug 2024 14:37:30 +0200 [thread overview]
Message-ID: <5e8d8441-ea4f-4da7-b55c-156da7fb0331@kernel.org> (raw)
In-Reply-To: <20240828122507.1323928-1-11162571@vivo.com>
On 28/08/2024 14:25, Yang Ruibin wrote:
> use dev_err_probe() instead of dev_err() to simplify the error path and
> standardize the format of the error code.
>
> Signed-off-by: Yang Ruibin <11162571@vivo.com>
> ---
> drivers/rtc/rtc-asm9260.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
> index a83b47e0d..2b7058ebb 100644
> --- a/drivers/rtc/rtc-asm9260.c
> +++ b/drivers/rtc/rtc-asm9260.c
> @@ -268,10 +268,8 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
> return PTR_ERR(priv->clk);
>
> ret = clk_prepare_enable(priv->clk);
> - if (ret) {
> - dev_err(dev, "Failed to enable clk!\n");
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to prepare clk!\n");
>
There is little simplification here, plus this cannot really defer. I
think it would be fine as part of other cleanups but as standalone
single patch I see no benefits of this.
Best regards,
Krzysztof
prev parent reply other threads:[~2024-08-28 12:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 12:25 [PATCH v1] rtc: rtc-asm9260: Switch to use dev_err_probe() Yang Ruibin
2024-08-28 12:35 ` Alexander Dahl
2024-08-28 12:37 ` Krzysztof Kozlowski [this message]
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=5e8d8441-ea4f-4da7-b55c-156da7fb0331@kernel.org \
--to=krzk@kernel.org \
--cc=11162571@vivo.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=opensource.kernel@vivo.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