Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753652AbdGSJhT (ORCPT ); Wed, 19 Jul 2017 05:37:19 -0400 Received: from mail-lf0-f52.google.com ([209.85.215.52]:35198 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102AbdGSJhO (ORCPT ); Wed, 19 Jul 2017 05:37:14 -0400 Date: Wed, 19 Jul 2017 11:37:22 +0200 From: Johan Hovold To: Keerthy Cc: linus.walleij@linaro.org, ssantosh@kernel.org, devicetree@vger.kernel.org, nsekhar@ti.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, fcooper@ti.com Subject: Re: [PATCH 1/4] gpio: davinci: Use devm_gpiochip_add_data in place of gpiochip_add_data Message-ID: <20170719093722.GW29638@localhost> References: <1500375436-9435-1-git-send-email-j-keerthy@ti.com> <1500375436-9435-2-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1500375436-9435-2-git-send-email-j-keerthy@ti.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 361 Lines: 9 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. Johan