From: "Csókás Bence" <csokas.bence@prolan.hu>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
<dmaengine@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-sunxi@lists.linux.dev>, <linux-kernel@vger.kernel.org>
Cc: Chen-Yu Tsai <wens@kernel.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Chen-Yu Tsai <wens@csie.org>, Vinod Koul <vkoul@kernel.org>,
Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH v4] dma-engine: sun4i: Use devm functions in probe()
Date: Sat, 22 Mar 2025 20:35:44 +0100 [thread overview]
Message-ID: <2da00161-723b-438a-9f70-1729312ec819@prolan.hu> (raw)
In-Reply-To: <e4249f3c-ca05-4fc7-b367-6ce280d0d749@wanadoo.fr>
Hi,
On 2025. 03. 22. 20:13, Christophe JAILLET wrote:
> Le 11/03/2025 à 19:02, Bence Csókás a écrit :
>> Clean up error handling by using devm functions
>> and dev_err_probe(). This should make it easier
>> to add new code, as we can eliminate the "goto
>> ladder" in probe().
>>
>> Suggested-by: Chen-Yu Tsai <wens@kernel.org>
>> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>> Acked-by: Chen-Yu Tsai <wens@csie.org>
>> Signed-off-by: Bence Csókás <csokas.bence@prolan.hu>
>> ---
>>
>> Notes:
>> Changes in v2:
>> * rebase on current next
>> Changes in v3:
>> * rebase on current next
>> * collect Jernej's tag
>> Changes in v4:
>> * rebase on current next
>> * collect Chen-Yu's tag
>>
>> drivers/dma/sun4i-dma.c | 31 ++++++-------------------------
>> 1 file changed, 6 insertions(+), 25 deletions(-)
>>
>> diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
>> index 24796aaaddfa..b10639720efd 100644
>> --- a/drivers/dma/sun4i-dma.c
>> +++ b/drivers/dma/sun4i-dma.c
>> @@ -1249,10 +1249,9 @@ static int sun4i_dma_probe(struct
>> platform_device *pdev)
>> if (priv->irq < 0)
>> return priv->irq;
>> - priv->clk = devm_clk_get(&pdev->dev, NULL);
>> + priv->clk = devm_clk_get_enabled(&pdev->dev, NULL);
>> if (IS_ERR(priv->clk)) {
>> - dev_err(&pdev->dev, "No clock specified\n");
>> - return PTR_ERR(priv->clk);
>> + return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk),
>> "Couldn't start the clock");
>
> Why removing the trailing \n everywhere?
>
> Any reference esxplaing why it is correct?
>
> CJ
Well, printk() will add a newline unless LOG_CONT is used. However,
while looking up this feature, it seems that the consensus is to keep
the `\n`s, even though they are not strictly needed anymore. I'll update
this.
Bence
prev parent reply other threads:[~2025-03-22 19:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 18:02 Bence Csókás
2025-03-11 19:33 ` Markus Elfring
2025-03-11 19:54 ` Markus Elfring
2025-03-12 8:53 ` Csókás Bence
2025-03-12 11:44 ` [v4] " Markus Elfring
2025-03-12 12:30 ` Csókás Bence
2025-03-22 18:46 ` [PATCH v4] " Csókás Bence
2025-03-22 19:13 ` Christophe JAILLET
2025-03-22 19:35 ` Csókás Bence [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=2da00161-723b-438a-9f70-1729312ec819@prolan.hu \
--to=csokas.bence@prolan.hu \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dmaengine@vger.kernel.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=vkoul@kernel.org \
--cc=wens@csie.org \
--cc=wens@kernel.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
all inboxes | Powered by JetHome®