USB: move decision to ignore FREEZE events

This patch (as987) changes the way FREEZE and PRETHAW suspend events
are handled in usbcore.  The decision about whether or not to ignore
them for non-root devices is pushed down into the USB-device driver,
instead of being made in the core code.

This is appropriate, since devices exported to a virtualized guest or
over a network may indeed need to handle these types of suspend, even
though normal devices don't.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 9148b69..c1cb94e 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -206,8 +206,13 @@
 	 */
 	if (!udev->parent)
 		rc = hcd_bus_suspend(udev);
+
+	/* Non-root devices don't need to do anything for FREEZE or PRETHAW */
+	else if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_PRETHAW)
+		rc = 0;
 	else
 		rc = usb_port_suspend(udev);
+
 	return rc;
 }