All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Otavio Salvador <otavio@ossystems.com.br>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	Jonathan Cameron <jic23@cam.ac.uk>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Bill Pemberton <wfp5p@virginia.edu>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	linux-iio@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH 2/5] ARM: mxs-lradc: Simplify mxs_lradc_trigger_init error handle
Date: Tue, 16 Jul 2013 01:00:26 +0200	[thread overview]
Message-ID: <201307160100.26746.marex@denx.de> (raw)
In-Reply-To: <CAP9ODKqOEd_002KJ3xFQ0uQfNEoZosrD9UGPQ=rLS0W3N77XwQ@mail.gmail.com>

Dear Otavio Salvador,

> On Mon, Jul 15, 2013 at 11:24 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > Dear Otavio Salvador,
> > 
> >> As we have a 'ret' variable with the iio_trigger_register return, this
> >> can be used as result.
> >> 
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >> ---
> >> 
> >>  drivers/staging/iio/adc/mxs-lradc.c | 6 ++----
> >>  1 file changed, 2 insertions(+), 4 deletions(-)
> >> 
> >> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
> >> b/drivers/staging/iio/adc/mxs-lradc.c index d92c97a..6d41846 100644
> >> --- a/drivers/staging/iio/adc/mxs-lradc.c
> >> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> >> @@ -671,14 +671,12 @@ static int mxs_lradc_trigger_init(struct iio_dev
> >> *iio) trig->ops = &mxs_lradc_trigger_ops;
> >> 
> >>       ret = iio_trigger_register(trig);
> >> 
> >> -     if (ret) {
> >> +     if (ret)
> >> 
> >>               iio_trigger_free(trig);
> >> 
> >> -             return ret;
> >> -     }
> >> 
> >>       iio->trig = trig;
> > 
> > You are still setting iio->trig , you dont want to do that in case of
> > failure
> 
> In this case it'd end being NULL I think, wouldn't it?

It won't, see the implementation in:

drivers/iio/industrialio-trigger.c

Best regards,
Marek Vasut

  reply	other threads:[~2013-07-15 23:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 14:22 [PATCH 1/5] ARM: dts: imx23-evk: enable USB PHY and controller Otavio Salvador
2013-07-15 14:22 ` Otavio Salvador
2013-07-15 14:22 ` [PATCH 2/5] ARM: mxs-lradc: Simplify mxs_lradc_trigger_init error handle Otavio Salvador
2013-07-15 14:24   ` Marek Vasut
2013-07-15 14:38     ` Otavio Salvador
2013-07-15 23:00       ` Marek Vasut [this message]
2013-07-16 12:38         ` Otavio Salvador
2013-07-15 14:22 ` [PATCH 3/5] ARM: dts: imx23-evk: enable Low Resolution ADC Otavio Salvador
2013-07-15 14:22   ` Otavio Salvador
2013-07-15 14:22 ` [PATCH 4/5] ARM: dts: imx23-olinuxino: " Otavio Salvador
2013-07-15 14:22   ` Otavio Salvador
2013-07-15 16:11   ` Alexandre Pereira da Silva
2013-07-15 16:11     ` Alexandre Pereira da Silva
2013-07-15 14:22 ` [PATCH 5/5] iio: add configuration option for debug support Otavio Salvador
2013-07-16  9:58   ` Jonathan Cameron
2013-07-16 10:26     ` Lars-Peter Clausen
2013-07-16 12:01       ` Otavio Salvador
2013-07-16 12:09         ` Lars-Peter Clausen
2013-07-16 16:11           ` Jonathan Cameron
2013-07-16 16:06       ` Jonathan Cameron
2013-07-15 15:39 ` [PATCH 1/5] ARM: dts: imx23-evk: enable USB PHY and controller Fabio Estevam
2013-07-15 15:39   ` Fabio Estevam
2013-07-15 16:39   ` Otavio Salvador
2013-07-15 16:39     ` Otavio Salvador
2013-07-16  1:30     ` Shawn Guo
2013-07-16  1:30       ` Shawn Guo
2013-07-16 12:25       ` Otavio Salvador
2013-07-16 12:25         ` Otavio Salvador
2013-07-16  3:42 ` Fabio Estevam
2013-07-16  3:42   ` Fabio Estevam
2013-07-16 12:24   ` Otavio Salvador
2013-07-16 12:24     ` Otavio Salvador

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=201307160100.26746.marex@denx.de \
    --to=marex@denx.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@cam.ac.uk \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=otavio@ossystems.com.br \
    --cc=wfp5p@virginia.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.