diff mbox

i2c: designware-pci: Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle()

Message ID 000301cf216d$0d08b4e0$271a1ea0$%han@samsung.com
State Rejected
Headers show

Commit Message

Jingoo Han Feb. 4, 2014, 5:50 a.m. UTC
Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle() to fix the
build warning when CONFIG_PM_RUNTIME is not selected. This is
because runtime PM callbacks defined by SET_RUNTIME_PM_OPS are
only used when the CONFIG_PM_RUNTIME is enabled.

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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/i2c/busses/i2c-designware-pcidrv.c |    2 ++
 1 file changed, 2 insertions(+)

Comments

Mika Westerberg Feb. 4, 2014, 10:05 a.m. UTC | #1
On Tue, Feb 04, 2014 at 02:50:46PM +0900, Jingoo Han wrote:
> Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle() to fix the
> build warning when CONFIG_PM_RUNTIME is not selected. This is
> because runtime PM callbacks defined by SET_RUNTIME_PM_OPS are
> only used when the CONFIG_PM_RUNTIME is enabled.
> 
> drivers/i2c/busses/i2c-designware-pcidrv.c:188:12: warning: 'i2c_dw_pci_runtime_idle' defined but not used [-Wunused-function]
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  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

While this fixes the compilation warning, I would like to get rid of the
whole runtime idle hook along with the PCI D-state management in the
driver.

I have a patch for this but I haven't been able to test it yet (hopefully I
can get it tested today).
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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,