ohci: avoid an unused variable warning
Subsystems (2)
PATCH 1/1 ohci: avoid an unused variable warning
With CONFIG_PM, but without CONFIG_PM_SLEEP, the intention of the conditional in ohci_pci_start() doesn't work since device_may_wakeup() references pdev only with the latter config option.
drivers/usb/host/ohci-pci.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-pci.c +1 -1
@@ -217,7 +217,7 @@ static int __devinit ohci_pci_start (strstruct ohci_hcd *ohci =hcd_to_ohci (hcd);int ret; -#ifdef CONFIG_PM /* avoid warnings about unused pdev */ +#ifdef CONFIG_PM_SLEEP /* avoid warnings about unused pdev */ if (hcd->self.controller) {struct pci_dev *pdev =to_pci_dev (hcd->self.controller);
Quoted 4 lines · Jan Beulich
With
CONFIG_PM, but withoutCONFIG_PM_SLEEP, the intention of the conditional inohci_pci_start()doesn't work sincedevice_may_wakeup()references pdev only with the latter config option.
Yuck. That means that runtime power management won't work correctly.
The same wakeup mechanisms that apply during SUSPEND and HIBERNATION are also used for runtime PM(*) ... which is allowed by CONFIG_PM, and which accordingly should not depend on PM_SLEEP.
I think the bug is that device_may_wakeup() now looks at CONFIG_PM_SLEEP instead of just CONFIG_PM.
- Dave
(*) Although ACPI has problems with the notion of runtime PM. For
example, it ignores PCI PME# signaling until PM_SLEEP transitions.