Re: [PATCH 5/7] iio: core: simplify some devm functions

Andy Shevchenko
2021-04-09T09:20:16Z

On Fri, Apr 9, 2021 at 10:22 AM Yicong Yang <yangyicong@hisilicon.com> wrote:
> On 2021/4/8 21:09, Alexandru Ardelean wrote:
> > On Thu, Apr 8, 2021 at 2:41 PM Yicong Yang <yangyicong@hisilicon.com> wrote:

...

> >> - if (!ptr)
> >> - return NULL;

> >> + if (!iio_dev)
> >> + return iio_dev;
> >
> > This is correct.
> > But the preference is usually:
> > if (!iio_dev)
> > return NULL;
> >
>
> since it returned iio_dev when failure before, so i just keep as is

Actually Alexandru has a good point. Compare the pieces I left above.

--
With Best Regards,
Andy Shevchenko