From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: maitysanchayan@gmail.com
Cc: Fabio Estevam <festevam@gmail.com>,
linux-input@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [PATCH] Input: colibri-vf50-ts - call iio_channel_release_all() in all error paths
Date: Mon, 22 Feb 2016 11:39:42 -0800 [thread overview]
Message-ID: <20160222193942.GC26177@dtor-ws> (raw)
In-Reply-To: <20160215050247.GA16995@Sanchayan-Arch.toradex.int>
On Mon, Feb 15, 2016 at 10:32:47AM +0530, maitysanchayan@gmail.com wrote:
> Hello Fabio,
>
> On 16-02-14 12:10:49, Fabio Estevam wrote:
> > From: Fabio Estevam <fabio.estevam@nxp.com>
> >
> > We need to make sure to call iio_channel_release_all() in all error
> > paths of the probe function.
> >
> > Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> > ---
> > Build-tested only.
> >
> > drivers/input/touchscreen/colibri-vf50-ts.c | 39 ++++++++++++++++++-----------
> > 1 file changed, 24 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/input/touchscreen/colibri-vf50-ts.c b/drivers/input/touchscreen/colibri-vf50-ts.c
> > index 69828d0..67f8a17 100644
> > --- a/drivers/input/touchscreen/colibri-vf50-ts.c
> > +++ b/drivers/input/touchscreen/colibri-vf50-ts.c
> > @@ -279,9 +279,8 @@ static int vf50_ts_probe(struct platform_device *pdev)
> >
> > error = devm_add_action(dev, vf50_ts_channel_release, channels);
> > if (error) {
> > - iio_channel_release_all(channels);
> > dev_err(dev, "Failed to register iio channel release action");
> > - return error;
> > + goto channel_release;
> > }
>
> As far as my understanding goes, from the discussion which happened during the
> submission of the patchset for this driver, the channel release gets taken care
> by the vf50_ts_channel_release function. Once it is successfully registered with
> devm_add_action, any further error returns in probe, will result in this function
> being called and the channels getting released.
That is correct, devm_add_action injects a custom action into devm
release sequence, so we should be releasing all channels when bailing
out due to an error.
Thanks.
--
Dmitry
prev parent reply other threads:[~2016-02-22 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-14 14:10 [PATCH] Input: colibri-vf50-ts - call iio_channel_release_all() in all error paths Fabio Estevam
2016-02-15 5:02 ` maitysanchayan
2016-02-22 19:39 ` Dmitry Torokhov [this message]
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=20160222193942.GC26177@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=maitysanchayan@gmail.com \
/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).