> +#ifdef CONFIG_PM > +static int rwdt_suspend(struct device *dev) > +{ > + struct platform_device *pdev; > + struct rwdt_priv *priv; > + > + pdev = to_platform_device(dev); > + priv = platform_get_drvdata(pdev); struct rwdt_priv *priv = dev_get_drvdata(dev); ? > + if (watchdog_active(&priv->wdev)) { > + rwdt_write(priv, priv->cks, RWTCSRA); > + } > + return 0; > +} > + > +static int rwdt_resume(struct device *dev) > +{ > + struct platform_device *pdev; > + struct rwdt_priv *priv; > + > + pdev = to_platform_device(dev); > + priv = platform_get_drvdata(pdev); ditto > + if (watchdog_active(&priv->wdev)) { > + rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA); > + } > + return 0; > +} > + > +static const struct dev_pm_ops rwdt_pm = { > + .suspend = rwdt_suspend, > + .resume = rwdt_resume, > +}; Use SIMPLE_DEV_PM_OPS macro (see stmp3xxx_rtc_wdt.c for an example) for more compact code and... > +#ifdef CONFIG_PM > + .pm = &rwdt_pm, > +#endif ... removing this ifdeffery?
Attachment:
signature.asc
Description: PGP signature