linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: andy.shevchenko@gmail.com
Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de,
	pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio:core: In map_array_register() cleanup in case of error
Date: Sun, 18 Oct 2020 03:11:54 +0200	[thread overview]
Message-ID: <1602983516-22913-1-git-send-email-LinoSanfilippo@gmx.de> (raw)
In-Reply-To: <CAHp75VfQ=fFn_r43VPV0uPCkozS2K=VQsuSEyj0mF+7QVsFQuA@mail.gmail.com>

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


  reply	other threads:[~2020-10-18  1:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 12:41 [PATCH] iio:core: In map_array_register() cleanup in case of error Lino Sanfilippo
2020-10-11 15:07 ` Jonathan Cameron
2020-10-11 18:05   ` Lino Sanfilippo
2020-10-11 18:22   ` [PATCH v2] " Lino Sanfilippo
2020-10-16 15:09     ` Andy Shevchenko
2020-10-18  1:11       ` Lino Sanfilippo [this message]
2020-10-18  1:11         ` [PATCH 1/2] iio:core: Introduce unlocked version of iio_map_array_unregister() Lino Sanfilippo
2020-10-18 18:21           ` Andy Shevchenko
2020-10-18  1:11         ` [PATCH 2/2] iio:core: In iio_map_array_register() cleanup in case of error Lino Sanfilippo
2020-10-18  9:56       ` [PATCH v2] iio:core: In map_array_register() " Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1602983516-22913-1-git-send-email-LinoSanfilippo@gmx.de \
    --to=linosanfilippo@gmx.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).