Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754279AbcDSMzM (ORCPT ); Tue, 19 Apr 2016 08:55:12 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:2603 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753420AbcDSMzI (ORCPT ); Tue, 19 Apr 2016 08:55:08 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Tue, 19 Apr 2016 05:53:07 -0700 Message-ID: <571627F5.7000307@nvidia.com> Date: Tue, 19 Apr 2016 18:13:33 +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: Thierry Reding CC: , , , , , Subject: Re: [PATCH V2 2/3] gpio: tegra: Remove the need of keeping device handle for gpio driver References: <1461059020-25373-1-git-send-email-ldewangan@nvidia.com> <1461059020-25373-2-git-send-email-ldewangan@nvidia.com> <20160419123323.GC8284@ulmo.ba.sec> In-Reply-To: <20160419123323.GC8284@ulmo.ba.sec> X-Originating-IP: [10.19.65.30] X-ClientProxiedBy: BGMAIL104.nvidia.com (10.25.59.13) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="ISO-8859-1"; 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: 1901 Lines: 46 On Tuesday 19 April 2016 06:03 PM, Thierry Reding wrote: > * PGP Signed by an unknown key > > On Tue, Apr 19, 2016 at 03:13:39PM +0530, Laxman Dewangan wrote: >> Remove the file static device handle variable for keeping device handle >> of driver as this is just required for error prints. The required device >> handle are available from gpiochip structure. >> >> Signed-off-by: Laxman Dewangan >> --- >> drivers/gpio/gpio-tegra.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c >> index 1b0c497..de022a9 100644 >> --- a/drivers/gpio/gpio-tegra.c >> +++ b/drivers/gpio/gpio-tegra.c >> @@ -80,7 +80,6 @@ struct tegra_gpio_soc_config { >> u32 upper_offset; >> }; >> >> -static struct device *dev; >> static struct irq_domain *irq_domain; >> static void __iomem *regs; >> static u32 tegra_gpio_bank_count; >> @@ -240,7 +239,8 @@ static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) >> >> ret = gpiochip_lock_as_irq(&tegra_gpio_chip, gpio); >> if (ret) { >> - dev_err(dev, "unable to lock Tegra GPIO %d as IRQ\n", gpio); >> + dev_err(tegra_gpio_chip.parent, >> + "unable to lock Tegra GPIO %d as IRQ\n", gpio); > Can't we get rid of the tegra_gpio_chip global variable altogether? We > set a struct tegra_gpio_bank * as the chip data for each of the > interrupts, so if we added a back link to the GPIO chip to each bank > we could easily get at the GPIO chip (and its parent device) from the > IRQ chip implementation. > We can get rid of all the global variables and can have only one (this is because our REGS macros uses the stride and changing then part of argument is too much change for single patch) as suggested by Stephen. I am planning to have rid of all global variables to on follow on patches once this series is fine.