Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1386126
| From | Laxman Dewangan <ldewangan@nvidia.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce |
| Date | 2016-04-25 10:50 +0200 |
| Message-ID | <rrKnp-2Hh-39@gated-at.bofh.it> (permalink) |
| References | <rq0FX-fr-3@gated-at.bofh.it> <rq0FX-fr-1@gated-at.bofh.it> <rrGMO-8iX-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH V3 4/4] gpio: tegra: Add support for gpio debounce Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-20 15:50 +0200
Re: [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce Stephen Warren <swarren@wwwdotorg.org> - 2016-04-21 20:40 +0200
Re: [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce Alexandre Courbot <gnurou@gmail.com> - 2016-04-25 07:00 +0200
Re: [PATCH V3 4/4] gpio: tegra: Add support for gpio debounce Laxman Dewangan <ldewangan@nvidia.com> - 2016-04-25 10:50 +0200
csiph-web