[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 4 Apr 2024 15:18:05 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Nuno Sa <nuno.sa@...log.com>
Cc: Petr Mladek <pmladek@...e.com>, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Olivier Moysan <olivier.moysan@...s.st.com>,
Jyoti Bhayana <jbhayana@...gle.com>,
Chris Down <chris@...isdown.name>,
John Ogness <john.ogness@...utronix.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org
Subject: Re: [PATCH 2/4] iio: temperature: ltc2983: convert to dev_err_probe()
On Thu, Apr 04, 2024 at 01:06:24PM +0200, Nuno Sa wrote:
> Use dev_err_probe() in the probe() path. While at it, made some simple
> improvements:
> * Declare a struct device *dev helper. This also makes the style more
> consistent (some places the helper was used and not in other places);
> * Explicitly included the err.h and errno.h headers;
> * Removed an useless else if();
> * Removed some unnecessary line breaks.
..
> if (!(thermo->sensor_config & LTC2983_THERMOCOUPLE_DIFF_MASK) &&
> - sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) {
It's better if you leave {} when the body goes after a single line.
This applies to your entire series.
> - dev_err(&st->spi->dev,
> - "Invalid chann:%d for differential thermocouple",
> - sensor->chan);
> - return ERR_PTR(-EINVAL);
> - }
> + sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN)
> + return dev_errp_probe(dev, -EINVAL,
> + "Invalid chann:%d for differential thermocouple",
> + sensor->chan);
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists