Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbcDFPJ5 (ORCPT ); Wed, 6 Apr 2016 11:09:57 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:13830 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbcDFPJz (ORCPT ); Wed, 6 Apr 2016 11:09:55 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 06 Apr 2016 08:07:53 -0700 Message-ID: <57052432.8070700@nvidia.com> Date: Wed, 6 Apr 2016 20:28:58 +0530 From: Laxman Dewangan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 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: X-Originating-IP: [10.19.65.30] X-ClientProxiedBy: DRUKMAIL102.nvidia.com (10.25.59.20) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1065 Lines: 28 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.