X-GM-THRID: 6201460938447519744 X-Received: by 10.112.54.197 with SMTP id l5mr3650329lbp.21.1443890556179; Sat, 03 Oct 2015 09:42:36 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.25.149.7 with SMTP id x7ls319217lfd.51.gmail; Sat, 03 Oct 2015 09:42:35 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr3663674lbb.17.1443890555577; Sat, 03 Oct 2015 09:42:35 -0700 (PDT) Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id q6si105580wif.2.2015.10.03.09.42.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Oct 2015 09:42:35 -0700 (PDT) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.17,628,1437429600"; d="scan'208";a="180875468" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Oct 2015 18:42:35 +0200 Date: Sat, 3 Oct 2015 18:42:33 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Shraddha Barke cc: outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH] Staging: iio: meter: Use devm_iio_trigger_alloc In-Reply-To: <1443890125-2419-1-git-send-email-shraddha.6596@gmail.com> Message-ID: References: <1443890125-2419-1-git-send-email-shraddha.6596@gmail.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 3 Oct 2015, Shraddha Barke wrote: > Introduce use of managed resource function devm_iio_trigger_alloc > instead of iio_trigger_alloc and remove corresponding calls > to iio_trigger_free in the probe and remove functions. > Also unnecessary label error_free_trig is dropped. > > Signed-off-by: Shraddha Barke > --- > drivers/staging/iio/meter/ade7758_trigger.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/iio/meter/ade7758_trigger.c b/drivers/staging/iio/meter/ade7758_trigger.c > index 5b35a7f..a5d52bb 100644 > --- a/drivers/staging/iio/meter/ade7758_trigger.c > +++ b/drivers/staging/iio/meter/ade7758_trigger.c > @@ -63,9 +63,9 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) > struct ade7758_state *st = iio_priv(indio_dev); > int ret; > > - st->trig = iio_trigger_alloc("%s-dev%d", > - spi_get_device_id(st->us)->name, > - indio_dev->id); > + st->trig = devm_iio_trigger_alloc("%s-dev%d", > + spi_get_device_id(st->us)->name, > + indio_dev->id); This should not compile. julia > if (!st->trig) { > ret = -ENOMEM; > goto error_ret; > @@ -77,7 +77,7 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) > spi_get_device_id(st->us)->name, > st->trig); > if (ret) > - goto error_free_trig; > + goto error_ret; > > st->trig->dev.parent = &st->us->dev; > st->trig->ops = &ade7758_trigger_ops; > @@ -93,8 +93,6 @@ int ade7758_probe_trigger(struct iio_dev *indio_dev) > > error_free_irq: > free_irq(st->us->irq, st->trig); > -error_free_trig: > - iio_trigger_free(st->trig); > error_ret: > return ret; > } > @@ -105,5 +103,4 @@ void ade7758_remove_trigger(struct iio_dev *indio_dev) > > iio_trigger_unregister(st->trig); > free_irq(st->us->irq, st->trig); > - iio_trigger_free(st->trig); > } > -- > 2.1.4 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1443890125-2419-1-git-send-email-shraddha.6596%40gmail.com. > For more options, visit https://groups.google.com/d/optout. >