On Wed, Apr 20, 2016 at 10:30 PM, Laxman Dewangan <ldewangan@xxxxxxxxxx> wrote:
bank->int_lvl[p] = tegra_gpio_readl(tgi,This last line is equivalent to doing
@@ -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;
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.
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.