lkml.org 
[lkml]   [2013]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] iio: ti_am335x_adc: Add continuous sampling support
On Wed, Sep 18, 2013 at 10:39:42AM +0100, Jonathan Cameron wrote:
> "Zubair Lutfullah :" <zubair.lutfullah@gmail.com> wrote:
> >On Tue, Sep 17, 2013 at 09:27:27PM -0700, Dmitry Torokhov wrote:
> >> Hi Zubair,
> >>
> >> On Tue, Sep 17, 2013 at 09:44:07AM +0500, Zubair Lutfullah wrote:
> >> > +
> >> > + ret = devm_request_threaded_irq(indio_dev->dev.parent,
> >> > + irq,
> >> > + pollfunc_th, pollfunc_bh,
> >> > + flags, indio_dev->name,
> >> > + indio_dev);
> >> > + if (ret)
> >> > + goto error_kfifo_free;
...
> >> > +
> >> > +error_free_irq:
> >> > + devm_free_irq(indio_dev->dev.parent, irq, indio_dev);
> >>
> >> What is the point of using devm_* here if you are doing explicit
> >> management of the resource anyway (you explicitly release it in all
> >> Dmitry
>
> The devm interfaces ensure this is all cleaned when the device is removed thus avoiding the need to free the stuff explicitly.
> Device will get freed on deliberate remove and on an error from probe. Hence you can drop all calls to devm free. The devm free functions are only needed if you wish to free in order to reallocate. This might happen if you want to change a buffer size for instance.
>

Thank-you for the feedback.
Updated and resent the series.

Zubair

> --


\
 
 \ /
  Last update: 2013-09-18 13:41    [W:0.084 / U:1.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site