From: Laxman Dewangan <ldewangan@nvidia.com>
To: <linus.walleij@linaro.org>, <gnurou@gmail.com>,
<swarren@wwwdotorg.org>, <thierry.reding@gmail.com>
Cc: <linux-gpio@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Laxman Dewangan <ldewangan@nvidia.com>
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 [thread overview]
Message-ID: <1460969178-20914-2-git-send-email-ldewangan@nvidia.com> (raw)
In-Reply-To: <1460969178-20914-1-git-send-email-ldewangan@nvidia.com>
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 <ldewangan@nvidia.com>
---
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
next prev parent reply other threads:[~2016-04-18 8:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-18 8:46 [PATCH 1/3] gpio: tegra: Don't open code of_device_get_match_data() Laxman Dewangan
2016-04-18 8:46 ` Laxman Dewangan [this message]
2016-04-18 16:29 ` [PATCH 2/3] gpio: tegra: Remove the need of keeping device handle for gpio driver Stephen Warren
2016-04-18 17:00 ` Laxman Dewangan
2016-04-19 15:58 ` Stephen Warren
2016-04-20 1:16 ` Alexandre Courbot
2016-04-18 8:46 ` [PATCH 3/3] gpio: tegra: Add support for gpio debounce Laxman Dewangan
2016-04-18 16:38 ` Stephen Warren
2016-04-18 17:06 ` Laxman Dewangan
2016-04-19 16:01 ` Stephen Warren
2016-04-18 16:29 ` [PATCH 1/3] gpio: tegra: Don't open code of_device_get_match_data() Stephen Warren
2016-04-20 0:56 ` Alexandre Courbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460969178-20914-2-git-send-email-ldewangan@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome