linux-mips
[Top] [All Lists]

Re: [PATCH 9/9 v3] spi: add Broadcom BCM63xx SPI controller driver

To: Florian Fainelli <florian@openwrt.org>
Subject: Re: [PATCH 9/9 v3] spi: add Broadcom BCM63xx SPI controller driver
From: Grant Likely <grant.likely@secretlab.ca>
Date: Tue, 31 Jan 2012 14:59:14 -0700
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, spi-devel-general@lists.sourceforge.net, Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
In-reply-to: <201201312220.41561.florian@openwrt.org>
References: <1328019048-5892-1-git-send-email-florian@openwrt.org> <1328019048-5892-10-git-send-email-florian@openwrt.org> <20120131201922.GE22611@ponder.secretlab.ca> <201201312220.41561.florian@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
On Tue, Jan 31, 2012 at 2:20 PM, Florian Fainelli <florian@openwrt.org> 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.

<Prev in Thread] Current Thread [Next in Thread>