[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zx-jUeQ9UbZt48ss@smile.fi.intel.com>
Date: Mon, 28 Oct 2024 16:44:33 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Aren Moynihan <aren@...cevolution.org>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Kaustabh Chakraborty <kauschluss@...root.org>,
Barnabás Czémán <trabarni@...il.com>,
Ondrej Jirman <megi@....cz>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, Dragan Simic <dsimic@...jaro.org>,
phone-devel@...r.kernel.org
Subject: Re: [PATCH v3 4/6] iio: light: stk3310: use dev_err_probe where
possible
On Mon, Oct 28, 2024 at 10:19:58AM -0400, Aren Moynihan wrote:
> Using dev_err_probe instead of dev_err and return makes the errors
> easier to understand by including the error name, and saves a little
> code.
...
> data->reg_##name = \
> devm_regmap_field_alloc(&client->dev, regmap, \
> stk3310_reg_field_##name); \
> - if (IS_ERR(data->reg_##name)) { \
> - dev_err(&client->dev, "reg field alloc failed.\n"); \
> - return PTR_ERR(data->reg_##name); \
> - } \
> + if (IS_ERR(data->reg_##name)) \
> + return dev_err_probe(&client->dev, \
> + PTR_ERR(data->reg_##name), \
> + "reg field alloc failed.\n"); \
> } while (0)
Same remark, if client is not used here, supply struct device pointer directly
and make these all lines better to read.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists