From: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V3 3/4] gpio: tegra: Get rid of all file scoped global variables
Date: Fri, 22 Apr 2016 00:05:08 +0530 [thread overview]
Message-ID: <57191D5C.1020401@nvidia.com> (raw)
In-Reply-To: <57191D0A.8010005-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
On Friday 22 April 2016 12:03 AM, Stephen Warren wrote:
> On 04/20/2016 07:30 AM, Laxman Dewangan wrote:
>> Move the file scoped multiple global variable from Tegra GPIO
>> driver to the structure and make this as gpiochip data which
>> can be referred from GPIO chip callbacks.
>
>> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
>
>> +#define GPIO_MSK_CNF(t, x) (GPIO_REG(t, x) + t->soc->upper_offset +
>> 0x00)
>> +#define GPIO_MSK_OE(t, x) (GPIO_REG(t, x) + t->soc->upper_offset
>> + 0x10)
>> +#define GPIO_MSK_OUT(t, x) (GPIO_REG(t, x) + t->soc->upper_offset
>> + 0X20)
>> +#define GPIO_MSK_INT_STA(t, x) (GPIO_REG(t, x) +
>> t->soc->upper_offset + 0x40)
>> +#define GPIO_MSK_INT_ENB(t, x) (GPIO_REG(t, x) +
>> t->soc->upper_offset + 0x50)
>> +#define GPIO_MSK_INT_LVL(t, x) (GPIO_REG(t, x) +
>> t->soc->upper_offset + 0x60)
>> +#define GPIO_MSK_DBC_EN(t, x) (GPIO_REG(t, x) +
>> t->soc->upper_offset + 0x30)
>
> DBC_EN/0x30 should be sorted correctly with the rest, and likely added
> in patch 4 instead.
>
>> @@ -276,19 +307,25 @@ static void tegra_gpio_irq_handler(struct
>> irq_desc *desc)
>
>> + struct tegra_gpio_info *tgi = bank->tgi;
>> +
>>
>> chained_irq_enter(chip, desc);
>
> No need for 2 blank lines there.
>
>> @@ -410,7 +462,7 @@ static int dbg_gpio_show(struct seq_file *s, void
>> *unused)
>>
>> static int dbg_gpio_open(struct inode *inode, struct file *file)
>> {
>> - return single_open(file, dbg_gpio_show, &inode->i_private);
>> + return single_open(file, dbg_gpio_show, inode->i_private);
>
> Can you explain that change? I'm not sure it's correct, but don't know
> why it was made.
>
we have sysfs interface to dump register as /sys/kernel/debug/tega_gpio
On this patch, I moved the tegra_gpio_info pointer as data for
s->private so that we will not need the global variable.
inode->i_private contains the pointer of the passed data. Hence we do
not need to pass the pointe ro pointer of data. If we dont do then we
will get wrong data pointer for tegra_gpio_info.
> Once those are fixed,
> Reviewed-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Thanks for RB.
next prev parent reply other threads:[~2016-04-21 18:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 13:30 [PATCH V3 0/4] gpio: tegra: Cleanups and support fro debounce Laxman Dewangan
2016-04-20 13:30 ` [PATCH V3 1/4] gpio: tegra: Don't open code of_device_get_match_data() Laxman Dewangan
2016-04-20 13:30 ` [PATCH V3 2/4] gpio: tegra: Make of_device_id compatible data to constant Laxman Dewangan
[not found] ` <1461159058-1439-3-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-21 18:33 ` Stephen Warren
2016-04-20 13:30 ` [PATCH V3 3/4] gpio: tegra: Get rid of all file scoped global variables Laxman Dewangan
2016-04-21 18:33 ` Stephen Warren
[not found] ` <57191D0A.8010005-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-04-21 18:35 ` Laxman Dewangan [this message]
2016-04-21 19:34 ` Stephen Warren
[not found] ` <1461159058-1439-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-20 13:30 ` [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce Laxman Dewangan
[not found] ` <1461159058-1439-5-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-04-21 18:35 ` Stephen Warren
2016-04-25 4:55 ` Alexandre Courbot
2016-04-25 8:29 ` Laxman Dewangan
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=57191D5C.1020401@nvidia.com \
--to=ldewangan-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).