Re: [PATCH mfd-next] mfd: max14577 and sec: add PM_SLEEP dependency tosuspend/resume
From: Krzysztof Kozlowski
Date: Tue Dec 17 2013 - 06:04:42 EST
On Tue, 2013-12-17 at 09:53 +0000, Lee Jones wrote:
> On Tue, 17 Dec 2013, Krzysztof Kozlowski wrote:
>
> > Add CONFIG_PM_SLEEP dependency to suspend and resume functions of
> > max14577 MFD driver and sec-core.c code.
> >
> > This fixes the warnings:
> > drivers/mfd/max14577.c:176:12: warning: âmax14577_suspendâ defined but not used [-Wunused-function]
> > drivers/mfd/max14577.c:199:12: warning: âmax14577_resumeâ defined but not used [-Wunused-function]
> > drivers/mfd/sec-core.c:347:12: warning: âsec_pmic_suspendâ defined but not used [-Wunused-function]
> > drivers/mfd/sec-core.c:369:12: warning: âsec_pmic_resumeâ defined but not used [-Wunused-function]
> >
> > Signed-off-by: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>
> > ---
> > drivers/mfd/max14577.c | 2 ++
> > drivers/mfd/sec-core.c | 2 ++
> > 2 files changed, 4 insertions(+)
> >
> > diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
> > index a5e1c370c609..1018a6644469 100644
> > --- a/drivers/mfd/max14577.c
> > +++ b/drivers/mfd/max14577.c
> > @@ -173,6 +173,7 @@ static const struct i2c_device_id max14577_i2c_id[] = {
> > };
> > MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
> >
> > +#ifdef CONFIG_PM_SLEEP
> > static int max14577_suspend(struct device *dev)
> > {
> > struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
> > @@ -208,6 +209,7 @@ static int max14577_resume(struct device *dev)
> >
> > return 0;
> > }
> > +#endif /* CONFIG_PM_SLEEP */
>
> Is this the best way we have of doing this?
>
> Isn't there a helper which casts these to NULL if unused?
If you are referring to SIMPLE_DEV_PM_OPS then this is already used in
these drivers. It didn't come up in the patch diff because the
SIMPLE_DEV_PM_OPS are used after the line:
static struct of_device_id max14577_dt_match[]
Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/