i2c: designware-pci: Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle()
Subsystems (3)
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
@@ -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]
Quoted 25 lines · Jingoo Han
Add
CONFIG_PM_RUNTIMEtoi2c_dw_pci_runtime_idle()to fix the build warning whenCONFIG_PM_RUNTIMEis not selected. This is because runtime PM callbacks defined bySET_RUNTIME_PM_OPSare only used when theCONFIG_PM_RUNTIMEis 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 <[email protected]>--- drivers/i2c/busses/i2c-designware-pcidrv.c | 2 ++ 1 file changed, 2 insertions(+)drivers/i2c/busses/i2c-designware-pcidrv.c +1
-0@@ -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).