Re: [PATCH v2] iio:core: In map_array_register() cleanup in case of error
From: Lino Sanfilippo
Date: Sat Oct 17 2020 - 21:14:38 EST
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_unregister() and then use
this one to unwind in error case. Thus we only need to add two lines of
code, so that Jonathan may be ok with adding it to the main code flow...
Regards,
Lino