Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752051AbcDRI6D (ORCPT ); Mon, 18 Apr 2016 04:58:03 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:13708 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbcDRI6A (ORCPT ); Mon, 18 Apr 2016 04:58:00 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Mon, 18 Apr 2016 01:56:02 -0700 From: Laxman Dewangan To: , , , CC: , , , Laxman Dewangan Subject: [PATCH 2/3] gpio: tegra: Remove the need of keeping device handle for gpio driver Date: Mon, 18 Apr 2016 14:16:17 +0530 Message-ID: <1460969178-20914-2-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1460969178-20914-1-git-send-email-ldewangan@nvidia.com> References: <1460969178-20914-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1554 Lines: 51 Remove the file static device handle variable as this is just required for prints. The required handle can be stored in tegra_gpio_chip and hence it become redundancy. 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); return ret; } @@ -465,8 +465,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) int i; int j; - dev = &pdev->dev; - config = of_device_get_match_data(&pdev->dev); if (!config) { dev_err(&pdev->dev, "Error: No device match found\n"); @@ -488,6 +486,8 @@ static int tegra_gpio_probe(struct platform_device *pdev) } tegra_gpio_chip.ngpio = tegra_gpio_bank_count * 32; + tegra_gpio_chip.parent = &pdev->dev; + tegra_gpio_banks = devm_kzalloc(&pdev->dev, tegra_gpio_bank_count * sizeof(*tegra_gpio_banks), -- 2.1.4