From patchwork Tue Apr 19 09:43:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 612055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qq0l13ZlNz9t8g for ; Tue, 19 Apr 2016 19:55:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543AbcDSJzZ (ORCPT ); Tue, 19 Apr 2016 05:55:25 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:8060 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753002AbcDSJzY (ORCPT ); Tue, 19 Apr 2016 05:55:24 -0400 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Tue, 19 Apr 2016 02:54:55 -0700 Received: from HQMAIL106.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Tue, 19 Apr 2016 02:52:24 -0700 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Tue, 19 Apr 2016 02:52:24 -0700 Received: from BGMAIL102.nvidia.com (10.25.59.11) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 19 Apr 2016 09:55:22 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by bgmail102.nvidia.com (10.25.59.11) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 19 Apr 2016 09:55:18 +0000 Received: from ldewanganubuntu-System-Product-Name.nvidia.com (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Tue, 19 Apr 2016 09:55:15 +0000 From: Laxman Dewangan To: , , , CC: , , , Laxman Dewangan Subject: [PATCH V2 2/3] gpio: tegra: Remove the need of keeping device handle for gpio driver Date: Tue, 19 Apr 2016 15:13:39 +0530 Message-ID: <1461059020-25373-2-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1461059020-25373-1-git-send-email-ldewangan@nvidia.com> References: <1461059020-25373-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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); 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),