USB: fix build error with CONFIG_PM_RUNTIME disabled
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Aug 2014 23:55:29 +0000 (16:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Aug 2014 23:55:29 +0000 (16:55 -0700)
commit bdd405d2a528 ("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: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: kbuild 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c

index 003cb6b1a6bfa30b4b30e07ec34c85f2d1733a01..46f5161c78913c75678ae3416f4031099b880090 100644 (file)
@@ -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
         *   usbcore.autosuspend = -1 then keep autosuspend disabled.
         */
+#ifdef CONFIG_PM_RUNTIME
        if (hdev->dev.power.autosuspend_delay >= 0)
                pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
+#endif
 
        /*
         * Hubs have proper suspend/resume support, except for root hubs