[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNuNedpsuPmdfumG@smile.fi.intel.com>
Date: Tue, 15 Aug 2023 17:36:41 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Marcus Folkesson <marcus.folkesson@...il.com>
Cc: Kent Gustavsson <kent@...oris.se>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Cosmin Tanislav <demonsingur@...il.com>,
Arnd Bergmann <arnd@...db.de>,
ChiYuan Huang <cy_huang@...htek.com>,
Haibo Chen <haibo.chen@....com>,
Ramona Bolboaca <ramona.bolboaca@...log.com>,
Ibrahim Tilki <Ibrahim.Tilki@...log.com>,
ChiaEn Wu <chiaen_wu@...htek.com>,
William Breathitt Gray <william.gray@...aro.org>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/6] iio: adc: mcp3911: make use of dev_err_probe()
On Mon, Aug 14, 2023 at 02:10:06PM +0200, Marcus Folkesson wrote:
> Simplify code by switch to dev_err_probe().
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@...il.com>
> ---
>
> Notes:
> v5:
> - New patch in this series
>
> drivers/iio/adc/mcp3911.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
> index 974c5bd923a6..681248a3ddde 100644
> --- a/drivers/iio/adc/mcp3911.c
> +++ b/drivers/iio/adc/mcp3911.c
> @@ -468,6 +468,7 @@ static int mcp3911_probe(struct spi_device *spi)
> {
> struct iio_dev *indio_dev;
> struct mcp3911 *adc;
> + struct device *dev = &spi->dev;
> int ret;
With preserved reversed xmas tree order (longer line comes first),
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*adc));
> @@ -482,10 +483,7 @@ static int mcp3911_probe(struct spi_device *spi)
> if (PTR_ERR(adc->vref) == -ENODEV) {
> adc->vref = NULL;
> } else {
> - dev_err(&adc->spi->dev,
> - "failed to get regulator (%ld)\n",
> - PTR_ERR(adc->vref));
> - return PTR_ERR(adc->vref);
> + return dev_err_probe(dev, PTR_ERR(adc->vref), "failed to get regulator\n");
> }
>
> } else {
> @@ -504,10 +502,7 @@ static int mcp3911_probe(struct spi_device *spi)
> if (PTR_ERR(adc->clki) == -ENOENT) {
> adc->clki = NULL;
> } else {
> - dev_err(&adc->spi->dev,
> - "failed to get adc clk (%ld)\n",
> - PTR_ERR(adc->clki));
> - return PTR_ERR(adc->clki);
> + return dev_err_probe(dev, PTR_ERR(adc->clki), "failed to get adc clk\n");
> }
> }
>
> --
> 2.41.0
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists