Commit a9ef803d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: fix build error with CONFIG_PM_RUNTIME disabled

commit bdd405d2 ("usb: hub: Prevent hub autosuspend if
usbcore.autosuspend is -1") causes a build error if CONFIG_PM_RUNTIME is
disabled.  Fix that by doing a simple #ifdef guard around it.
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Michael Welling <mwelling@emacinc.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c38405c
...@@ -1732,8 +1732,10 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -1732,8 +1732,10 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
* - If user has indicated to prevent autosuspend by passing * - If user has indicated to prevent autosuspend by passing
* usbcore.autosuspend = -1 then keep autosuspend disabled. * usbcore.autosuspend = -1 then keep autosuspend disabled.
*/ */
#ifdef CONFIG_PM_RUNTIME
if (hdev->dev.power.autosuspend_delay >= 0) if (hdev->dev.power.autosuspend_delay >= 0)
pm_runtime_set_autosuspend_delay(&hdev->dev, 0); pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
#endif
/* /*
* Hubs have proper suspend/resume support, except for root hubs * Hubs have proper suspend/resume support, except for root hubs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment