On Tue, Jan 31, 2012 at 2:20 PM, Florian Fainelli <florian@xxxxxxxxxxx> wrote: > On Tuesday 31 January 2012 21:19:22 Grant Likely wrote: >> > +static const struct dev_pm_ops bcm63xx_spi_pm_ops = { >> > + .suspend = bcm63xx_spi_suspend, >> > + .resume = bcm63xx_spi_resume, >> > +}; >> > + >> > +#define BCM63XX_SPI_PM_OPS (&bcm63xx_spi_pm_ops) >> > +#else >> > +#define BCM63XX_SPI_PM_OPS NULL >> >> A bit ugly. Do this instead in the else clause and drop the >> BCM63XX_SPI_PM_OPS: >> >> #define bcm63xx_spi_pm_ops NULL > > This won't work, because driver.pm must be set to a pointer to a struct > dev_pm_ops, that's why I used this trick to make it build fine in both cases. > If I follow your advice, with driver.pm = &bcm63xx_spi_pm_ops, it won't build > for CONFIG_PM=n. Okay, fair enough. g.