Skip to contentSkip to conversation

ohci: avoid an unused variable warning

PATCH In review Jan Beulich 2 participants 2 messages Dec 13, 2007 – Dec 14, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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 (str
 	struct 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);
 
#1 lore raw
Quoted 4 lines · Jan Beulich

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.

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.