From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755105AbdABH4I (ORCPT ); Mon, 2 Jan 2017 02:56:08 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35945 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754741AbdABH4H (ORCPT ); Mon, 2 Jan 2017 02:56:07 -0500 Subject: Re: [PATCH V1] mtd : nand : denali :- No need of devm functions To: Boris Brezillon References: <1481123711-7205-1-git-send-email-arvind.yadav.cs@gmail.com> <20161229182443.2bdb37a7@bbrezillon> Cc: richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, cyrille.pitchen@atmel.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org From: Arvind Yadav Message-ID: <4bf4a97b-c2c3-51db-9bb1-61e6d433c7ca@gmail.com> Date: Mon, 2 Jan 2017 13:26:01 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161229182443.2bdb37a7@bbrezillon> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org yes, if Memory is live out side function. Then devm_kzalloc() approach has the benefit of simplifying the different error paths. Here, Memory is alive with in function. we are going to free allocate memory then why we need devm api. In this case Devm will first add this entry to list and immediately it will remove from list. In this case, It's just a overhead for devm api. -Arvind On Thursday 29 December 2016 10:54 PM, Boris Brezillon wrote: > The > devm_kzalloc() approach has the benefit of simplifying the different > error paths.