RE: [PATCH v2 08/18] GPIO: OMAP: Use wkup regs off/suspend support flag

DebBarma, Tarun Kanti
2011-06-30T13:35:52Z

Kevin,
[...]
> > -#endif
> > - default:
> > - continue;
> > - }
> > + if (!bank->suspend_support)
> > + return 0;
>
> Rather than check the flag here in every suspend, don't add a suspend
> method in dev_pm_ops for banks that don't have the wkup_* registers.
While trying to implement this comment I am facing issues:

struct device_driver {
...
const struct dev_pm_ops *pm;

...
};
Since *pm is constant we can not assign pm->suspend/resume dynamically.
Also, I am not sure if it is permissible to have following code in probe:

... omap_gpio_probe(...)
{
...
if (bank->regs->wkup_status) {
pdrv->driver.pm->suspend = omap_gpio_suspend;
pdrv->driver.pm->resume = omap_gpio_resume;
}
...