From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <57052432.8070700@nvidia.com> Date: Wed, 6 Apr 2016 20:28:58 +0530 From: Laxman Dewangan MIME-Version: 1.0 To: Daniel Baluta CC: Jonathan Cameron , Jonathan Corbet , Hartmut Knaack , Lars-Peter Clausen , "Peter Meerwald-Stadler" , , "Linux Kernel Mailing List" , "linux-iio@vger.kernel.org" Subject: Re: [PATCH 1/3] iio: core: Add devm_ APIs for iio_channel_{get,release} References: <1459938668-9180-1-git-send-email-ldewangan@nvidia.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed List-ID: Hi Daniel, On Wednesday 06 April 2016 07:19 PM, Daniel Baluta wrote: > On Wed, Apr 6, 2016 at 1:31 PM, Laxman Dewangan wrote: >> Some of kernel driver uses the IIO framework to get the sensor >> value via ADC or IIO HW driver. The client driver get iio channel >> by iio_channel_get() and release it by calling iio_channel_release(). >> >> Add resource managed version (devm_*) of these APIs so that if client >> calls the devm_iio_channel_get() then it need not to release it explicitly, >> it can be done by managed device framework when driver get un-binded. >> >> This reduces the code in error path and also need of .remove callback in >> some cases. >> > Please provide at least one example of code that uses this API. Most of client for this APIs are in other subsystem. When I was working on the patch [PATCH 2/2] thermal: generic-adc: Add ADC based thermal sensor driver if I have devm_iio_channel_get() then I can get .remove callback at all. I did not use this new APIs in my patch because they are in different subsystem.