Re: [PATCH v2] iio:core: In map_array_register() cleanup in case of error

2020-10-18 Thread Jonathan Cameron
On Fri, 16 Oct 2020 18:09:48 +0300 Andy Shevchenko wrote: > On Sun, Oct 11, 2020 at 9:24 PM Lino Sanfilippo wrote: > > > > In function map_array_register() properly rewind in case of error. > > Furthermore remove the now superfluous initialization of "ret" with 0. > > > int iio_map_array_reg

Re: [PATCH v2] iio:core: In map_array_register() cleanup in case of error

2020-10-17 Thread Lino Sanfilippo
Hi Andy, Thanks for you suggestion. I agree that it is nicer to reuse the cleanup in iio_map_array_unregister() than to reimplement it. However I would like to avoid dropping and regaining the mutex in case of error. What about the attached approach: Introduce an unlocked version of iio_map_array

Re: [PATCH v2] iio:core: In map_array_register() cleanup in case of error

2020-10-16 Thread Andy Shevchenko
On Sun, Oct 11, 2020 at 9:24 PM Lino Sanfilippo wrote: > > In function map_array_register() properly rewind in case of error. > Furthermore remove the now superfluous initialization of "ret" with 0. > int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps) > { > - int

[PATCH v2] iio:core: In map_array_register() cleanup in case of error

2020-10-11 Thread Lino Sanfilippo
In function map_array_register() properly rewind in case of error. Furthermore remove the now superfluous initialization of "ret" with 0. Signed-off-by: Lino Sanfilippo --- drivers/iio/inkern.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/iio/inkern.c