Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755593AbcDGKze (ORCPT ); Thu, 7 Apr 2016 06:55:34 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:11927 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbcDGKzc (ORCPT ); Thu, 7 Apr 2016 06:55:32 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 07 Apr 2016 03:53:27 -0700 Message-ID: <57063A12.4080200@nvidia.com> Date: Thu, 7 Apr 2016 16:14:34 +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: Lee Jones CC: , , , , , , Subject: Re: [PATCH 01/20] mfd: Add devm_ apis for mfd_add_devices and mfd_release_devices References: <1459856912-17859-1-git-send-email-ldewangan@nvidia.com> <1459856912-17859-2-git-send-email-ldewangan@nvidia.com> <20160407104403.GZ3323@x1> In-Reply-To: <20160407104403.GZ3323@x1> 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: 1272 Lines: 48 Hi Lee, Thanks for review. I will send another patch with incorporating your comments. On Thursday 07 April 2016 04:14 PM, Lee Jones wrote: > On Tue, 05 Apr 2016, Laxman Dewangan wrote: > > + if (!ret) { > + *ptr = dev; > + devres_add(dev, ptr); > + } else { > + devres_free(ptr); > + } > Switch these round. If you encounter a problem, free and return. If > not, skip the error handling and add the device outside of the if(). Like below? if (ret) { devres_free(ptr); return ret; } *ptr = dev; devres_add(dev, ptr); return ret; >> + * Remove all mfd devices added on the device. > s/mfd/MFD/ > > 'D' already means devices, so here you are saying "devices devices". > Please re-word. Besides, you need to be more specific as to which > "devices on the devices" you are detailing, since this sentence > doesn't really make a great deal of sense. Wanted to say Remove all devices added by mfd_add_devices() from parent device. >> + * Normally this function will not need to be called and the resource >> + * management code will ensure that the resource is freed. > Then what is the purpose of providing it? Do you have a user? To have pair of release. I have not seen the usage of most of devm_*_release() function other than devm_kfree().