Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbdGSJ7j (ORCPT ); Wed, 19 Jul 2017 05:59:39 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:13952 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbdGSJ7g (ORCPT ); Wed, 19 Jul 2017 05:59:36 -0400 Subject: Re: [PATCH 1/4] gpio: davinci: Use devm_gpiochip_add_data in place of gpiochip_add_data To: Johan Hovold References: <1500375436-9435-1-git-send-email-j-keerthy@ti.com> <1500375436-9435-2-git-send-email-j-keerthy@ti.com> <20170719093722.GW29638@localhost> CC: , , , , , , , , From: Keerthy Message-ID: <32f70ccc-e52e-af86-87ec-f7a243d518b0@ti.com> Date: Wed, 19 Jul 2017 15:28:21 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170719093722.GW29638@localhost> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 492 Lines: 16 On Wednesday 19 July 2017 03:07 PM, Johan Hovold wrote: > On Tue, Jul 18, 2017 at 04:27:13PM +0530, Keerthy wrote: >> Use the devm version of gpiochip_add_data and pass on the >> return value. Reset the static variables to 0 before returning. > > You need to describe not just what you do, but also why you it. In this > case, your fixing memory leaks and the gpio chip being left registered > if this driver is unbound. Sure i can add more description as mentioned above. > > Johan >