2013-09-26 22:29:49

by Vincent Stehlé

[permalink] [raw]
Subject: [PATCH] i2c-designware: define i2c_dw_pci_runtime_idle only with runtime pm

Make sure i2c_dw_pci_runtime_idle() is defined only when actually used, when
CONFIG_PM_RUNTIME is defined.

This fixes the following compilation warning:

drivers/i2c/busses/i2c-designware-pcidrv.c:188:12: warning: ‘i2c_dw_pci_runtime_idle’ defined but not used [-Wunused-function]

Signed-off-by: Vincent Stehlé <[email protected]>
Cc: Wolfram Sang <[email protected]>
---
drivers/i2c/busses/i2c-designware-pcidrv.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index f6ed06c..2b5d3a6 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -185,6 +185,7 @@ static int i2c_dw_pci_resume(struct device *dev)
return 0;
}

+#ifdef CONFIG_PM_RUNTIME
static int i2c_dw_pci_runtime_idle(struct device *dev)
{
int err = pm_schedule_suspend(dev, 500);
@@ -194,6 +195,7 @@ static int i2c_dw_pci_runtime_idle(struct device *dev)
return 0;
return -EBUSY;
}
+#endif

static const struct dev_pm_ops i2c_dw_pm_ops = {
.resume = i2c_dw_pci_resume,
--
1.8.4.rc3


2013-09-27 02:43:18

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c-designware: define i2c_dw_pci_runtime_idle only with runtime pm

On Fri, Sep 27, 2013 at 12:24:03AM +0200, Vincent Stehlé wrote:
> Make sure i2c_dw_pci_runtime_idle() is defined only when actually used, when
> CONFIG_PM_RUNTIME is defined.
>
> This fixes the following compilation warning:
>
> drivers/i2c/busses/i2c-designware-pcidrv.c:188:12: warning: ‘i2c_dw_pci_runtime_idle’ defined but not used [-Wunused-function]
>
> Signed-off-by: Vincent Stehlé <[email protected]>
> Cc: Wolfram Sang <[email protected]>

I wonder if this fix is complete? Mika?

> ---
> drivers/i2c/busses/i2c-designware-pcidrv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> index f6ed06c..2b5d3a6 100644
> --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> @@ -185,6 +185,7 @@ static int i2c_dw_pci_resume(struct device *dev)
> return 0;
> }
>
> +#ifdef CONFIG_PM_RUNTIME
> static int i2c_dw_pci_runtime_idle(struct device *dev)
> {
> int err = pm_schedule_suspend(dev, 500);
> @@ -194,6 +195,7 @@ static int i2c_dw_pci_runtime_idle(struct device *dev)
> return 0;
> return -EBUSY;
> }
> +#endif
>
> static const struct dev_pm_ops i2c_dw_pm_ops = {

Shouldn't this be using UNIVERSAL_DEV_PM_OPS with the suspend and resume
function #ifdeffed by CONFIG_PM_SLEEP?

> .resume = i2c_dw_pci_resume,
> --
> 1.8.4.rc3
>


Attachments:
(No filename) (1.40 kB)
signature.asc (836.00 B)
Digital signature
Download all attachments

2013-09-27 08:17:37

by Mika Westerberg

[permalink] [raw]
Subject: Re: [PATCH] i2c-designware: define i2c_dw_pci_runtime_idle only with runtime pm

On Fri, Sep 27, 2013 at 04:43:13AM +0200, Wolfram Sang wrote:
> On Fri, Sep 27, 2013 at 12:24:03AM +0200, Vincent Stehlé wrote:
> > Make sure i2c_dw_pci_runtime_idle() is defined only when actually used, when
> > CONFIG_PM_RUNTIME is defined.
> >
> > This fixes the following compilation warning:
> >
> > drivers/i2c/busses/i2c-designware-pcidrv.c:188:12: warning: ‘i2c_dw_pci_runtime_idle’ defined but not used [-Wunused-function]
> >
> > Signed-off-by: Vincent Stehlé <[email protected]>
> > Cc: Wolfram Sang <[email protected]>
>
> I wonder if this fix is complete? Mika?
>
> > ---
> > drivers/i2c/busses/i2c-designware-pcidrv.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> > index f6ed06c..2b5d3a6 100644
> > --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> > +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> > @@ -185,6 +185,7 @@ static int i2c_dw_pci_resume(struct device *dev)
> > return 0;
> > }
> >
> > +#ifdef CONFIG_PM_RUNTIME
> > static int i2c_dw_pci_runtime_idle(struct device *dev)
> > {
> > int err = pm_schedule_suspend(dev, 500);
> > @@ -194,6 +195,7 @@ static int i2c_dw_pci_runtime_idle(struct device *dev)
> > return 0;
> > return -EBUSY;
> > }
> > +#endif
> >
> > static const struct dev_pm_ops i2c_dw_pm_ops = {
>
> Shouldn't this be using UNIVERSAL_DEV_PM_OPS with the suspend and resume
> function #ifdeffed by CONFIG_PM_SLEEP?

Yes, I think that would be better.

>
> > .resume = i2c_dw_pci_resume,
> > --
> > 1.8.4.rc3
> >