Skip to contentSkip to conversation

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

PATCH In review Jingoo Han 2 participants 2 messages Feb 4, 2014 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 i2c: designware-pci: Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle()

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]

---
 drivers/i2c/busses/i2c-designware-pcidrv.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-designware-pcidrv.c +2 -0
index f6ed06c..2b5d3a6 100644
@@ -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,
Signature · 1 line
1.7.10.4

A message that is not in the archive (sent off-list or not yet received): 000301cf216d$0d08b4e0$271a1ea0$%[email protected]

#2 lore raw
Quoted 25 lines · Jingoo Han

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]

---
 drivers/i2c/busses/i2c-designware-pcidrv.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -0
index f6ed06c..2b5d3a6 100644
@@ -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);

drivers/i2c/busses/i2c-designware-pcidrv.c static int i2c_dw_pci_runtime_idle(struct device *dev) · line 198

Quoted 4 lines
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -0
@@ -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).