lkml.org 
[lkml]   [2013]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/5] ARM: mxs-lradc: Simplify mxs_lradc_trigger_init error handle
From
On Mon, Jul 15, 2013 at 8:00 PM, Marek Vasut <marex@denx.de> wrote:
> 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

Agreed; will drop this from v2.

--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750


\
 
 \ /
  Last update: 2013-07-16 15:21    [W:0.056 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site