[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241207181058.3df9c7a0@jic23-huawei>
Date: Sat, 7 Dec 2024 18:10:58 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: prabhakar.mahadev-lad.rj@...renesas.com, lars@...afoo.de,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
geert+renesas@...der.be, magnus.damm@...il.com, mturquette@...libre.com,
sboyd@...nel.org, p.zabel@...gutronix.de, linux-iio@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org, Claudiu Beznea
<claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v2 02/15] iio: adc: rzg2l_adc: Convert dev_err() to
dev_err_probe()
On Fri, 6 Dec 2024 13:13:24 +0200
Claudiu <claudiu.beznea@...on.dev> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
>
> Convert all occurrences of dev_err() in the probe path to dev_err_probe().
> This improves readability and simplifies the code.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Hi Claudiu,
> + if (IS_ERR(adc->presetn))
> + return dev_err_probe(dev, PTR_ERR(adc->presetn), "failed to get presetn\n");
>
> ret = reset_control_deassert(adc->adrstn);
> - if (ret) {
> - dev_err(&pdev->dev, "failed to deassert adrstn pin, %d\n", ret);
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret, "failed to deassert adrstn pin, %d\n", ret);
Take a closer look at the implementation of dev_err_probe().
It already prints the return code (where appropriate) and in a pretty text form
which is easier to read. So we should not print it again.
I'd also prefer wrapping some of the longer lines in here a little earlier. For IIO
I still prefer to stay under 80 chars or only a little over it where it doesn't
hurt readability.
Jonathan
Powered by blists - more mailing lists