lkml.org 
[lkml]   [2022]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: frequency: admv1014: return -EINVAL directly
On Sat, 20 Aug 2022 18:56:53 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Fri, Aug 19, 2022 at 8:41 PM Jonathan Cameron <jic23@kernel.org> wrote:
> > On Fri, 19 Aug 2022 13:41:17 +0300
> > Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
> >
> > > Remove extra step where the error code is assigned to the `ret`
> > > variable.
> > >
> > > Return instead error code directly.
>
> ...
>
> > Change is fine, but I've dropped the fixes tag. The code before this
> > wasn't broken, just longer than it needed to be. We don't want the noise
> > of this getting backported because someone sees the fixes tag and thinks
> > there is a reason it needs to be.
> >
> > Applied to the togreg branch of iio.git
>
> Haven't checked myself if it's possible, but shouldn;'t we go further
> and return dev_err_probe()?

Good idea, but only as part of a patch doing that throughout the driver.
So follow up patch perhaps..

>
> > > chip_id = FIELD_GET(ADMV1014_CHIP_ID_MSK, chip_id);
> > > if (chip_id != ADMV1014_CHIP_ID) {
> > > dev_err(&spi->dev, "Invalid Chip ID.\n");
> > > - ret = -EINVAL;
> > > - return ret;
> > > + return -EINVAL;
> > > }
>
>

\
 
 \ /
  Last update: 2022-08-21 19:04    [W:0.069 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site