* [PATCH mfd-next] mfd: max14577 and sec: add PM_SLEEP dependency to suspend/resume
@ 2013-12-17 9:28 Krzysztof Kozlowski
2013-12-17 9:53 ` Lee Jones
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2013-12-17 9:28 UTC (permalink / raw)
To: Samuel Ortiz, Lee Jones, Sangbeom Kim, linux-kernel
Cc: Stephen Rothwell, Krzysztof Kozlowski
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@samsung.com>
---
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 */
static struct of_device_id max14577_dt_match[] = {
{ .compatible = "maxim,max14577", },
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 56615af42a28..455e3a8fb95d 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -343,6 +343,7 @@ static int sec_pmic_remove(struct i2c_client *i2c)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
static int sec_pmic_suspend(struct device *dev)
{
struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
@@ -377,6 +378,7 @@ static int sec_pmic_resume(struct device *dev)
return 0;
}
+#endif /* CONFIG_PM_SLEEP */
static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH mfd-next] mfd: max14577 and sec: add PM_SLEEP dependency to suspend/resume
2013-12-17 9:28 [PATCH mfd-next] mfd: max14577 and sec: add PM_SLEEP dependency to suspend/resume Krzysztof Kozlowski
@ 2013-12-17 9:53 ` Lee Jones
2013-12-17 11:04 ` Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2013-12-17 9:53 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Samuel Ortiz, Sangbeom Kim, linux-kernel, Stephen Rothwell
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@samsung.com>
> ---
> 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?
> static struct of_device_id max14577_dt_match[] = {
> { .compatible = "maxim,max14577", },
> diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
> index 56615af42a28..455e3a8fb95d 100644
> --- a/drivers/mfd/sec-core.c
> +++ b/drivers/mfd/sec-core.c
> @@ -343,6 +343,7 @@ static int sec_pmic_remove(struct i2c_client *i2c)
> return 0;
> }
>
> +#ifdef CONFIG_PM_SLEEP
> static int sec_pmic_suspend(struct device *dev)
> {
> struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
> @@ -377,6 +378,7 @@ static int sec_pmic_resume(struct device *dev)
>
> return 0;
> }
> +#endif /* CONFIG_PM_SLEEP */
>
> static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume);
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH mfd-next] mfd: max14577 and sec: add PM_SLEEP dependency to suspend/resume
2013-12-17 9:53 ` Lee Jones
@ 2013-12-17 11:04 ` Krzysztof Kozlowski
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2013-12-17 11:04 UTC (permalink / raw)
To: Lee Jones; +Cc: Samuel Ortiz, Sangbeom Kim, linux-kernel, Stephen Rothwell
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@samsung.com>
> > ---
> > 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-17 11:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17 9:28 [PATCH mfd-next] mfd: max14577 and sec: add PM_SLEEP dependency to suspend/resume Krzysztof Kozlowski
2013-12-17 9:53 ` Lee Jones
2013-12-17 11:04 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox