public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Alexandre Courbot <gnurou@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce
Date: Mon, 25 Apr 2016 13:59:31 +0530	[thread overview]
Message-ID: <571DD56B.9030506@nvidia.com> (raw)
In-Reply-To: <CAAVeFuK2pQpy9Srg7PJNCMTKkXeLoqGjzVDmuWHox71tHV3-jQ@mail.gmail.com>


On Monday 25 April 2016 10:25 AM, Alexandre Courbot wrote:
> On Wed, Apr 20, 2016 at 10:30 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>>                       bank->int_lvl[p] = tegra_gpio_readl(tgi,
>> @@ -550,6 +598,9 @@ static int tegra_gpio_probe(struct platform_device *pdev)
>>
>>          platform_set_drvdata(pdev, tgi);
>>
>> +       if (!config->debounce_supported)
>> +               tgi->gc->set_debounce = NULL;
> This last line is equivalent to doing
>
>       tegra_gpio_chip.set_debounce = NULL
>
> Which means that after that no one can reinstanciate this driver and
> use debounce. Granted, this does not happen in real life, but the
> purpose of the previous patch that removes all static variables is
> supposedly to make this scenario possible. I think you can easily fix
> this though: make tgi->gc a non-pointer member, do tgi->gc =
> tegra_gpio_chip to copy the initial data, and then set
> tgi->gc.set_debounce to NULL if needed.

As there is only single instance of the tegra gpio driver, I avoided the 
copy of the tegra_gpio_chip.
I am not expecting multiple instance of this driver and hence should be 
fine. When multiple instances are needed, it can be just use as:

But let me make this as you suggested.


> tegra_gpio_chip can then be made constant, and maybe even __initdata?
I have not seen the usage of __initdata now a days. I think it is 
removed from most of places.
Will use the const.

      reply	other threads:[~2016-04-25  8:41 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
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
2016-04-21 18:35     ` Laxman Dewangan
2016-04-21 19:34       ` Stephen Warren
2016-04-20 13:30 ` [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce Laxman Dewangan
2016-04-21 18:35   ` Stephen Warren
2016-04-25  4:55   ` Alexandre Courbot
2016-04-25  8:29     ` Laxman Dewangan [this message]

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=571DD56B.9030506@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