lkml.org 
[lkml]   [2024]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 4/4] iio: common: scmi_iio: convert to dev_err_probe()
From
Date
On Tue, 2024-04-23 at 18:50 +0300, Andy Shevchenko wrote:
> On Tue, Apr 23, 2024 at 05:20:33PM +0200, Nuno Sa via B4 Relay wrote:
> > From: Nuno Sa <nuno.sa@analog.com>
> >
> > Make use of dev_err_probe() and dev_err_ptr_probe() to simplify error paths
> > during probe.
>
> ...
>
> > + return dev_err_ptr_probe(&iiodev->dev, ret,
> > + "Error in registering sensor update
> > notifier for sensor %s err %d",
>
> \n

sure...

>
> > + sensor->sensor_info->name, ret);
>
> ...
>
> > + return dev_err_probe(dev, -EINVAL,
> > +      "SCMI sensor %d has missing
> > info\n", i);
>
> One line? (It's 99 if you use relaxed limit).

Being this IIO, Jonathan prefers to stick the old limit unless readability is hurt...
>
> ...
>
> > + return dev_err_probe(dev, PTR_ERR(scmi_iio_dev),
> > +      "failed to allocate IIO device for
> > sensor %s: %ld\n",
> > +      sensor_info->name,
> > PTR_ERR(scmi_iio_dev));
>
> Please, be sure you remove double error code printing, dev_err_probe() does it
> for you already. (This applies to all places like this, if any, in the entire
> series.)

Up... blind conversion. Thanks!

- Nuno Sá


\
 
 \ /
  Last update: 2024-05-02 13:33    [W:0.065 / U:1.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site