Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: remove references to dev.power.power_state

This revised patch (as891b) removes two unnecessary references to
intf->dev.power.power_state from usb-storage, and replaces a reference
to root_hub->dev.power.power_state with a check of hcd->state. This
is in preparation for the removal of dev.power.power_state, which is
already deprecated.

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

authored by

Alan Stern and committed by
Greg Kroah-Hartman
f3fd77cd 8adb4786

+2 -3
+2 -1
drivers/usb/core/hcd-pci.c
··· 207 207 * We must ignore the FREEZE vs SUSPEND distinction here, because 208 208 * otherwise the swsusp will save (and restore) garbage state. 209 209 */ 210 - if (hcd->self.root_hub->dev.power.power_state.event == PM_EVENT_ON) 210 + if (!(hcd->state == HC_STATE_SUSPENDED || 211 + hcd->state == HC_STATE_HALT)) 211 212 return -EBUSY; 212 213 213 214 if (hcd->driver->suspend) {
-2
drivers/usb/storage/usb.c
··· 197 197 US_DEBUGP("%s\n", __FUNCTION__); 198 198 if (us->suspend_resume_hook) 199 199 (us->suspend_resume_hook)(us, US_SUSPEND); 200 - iface->dev.power.power_state.event = message.event; 201 200 202 201 /* When runtime PM is working, we'll set a flag to indicate 203 202 * whether we should autoresume when a SCSI request arrives. */ ··· 214 215 US_DEBUGP("%s\n", __FUNCTION__); 215 216 if (us->suspend_resume_hook) 216 217 (us->suspend_resume_hook)(us, US_RESUME); 217 - iface->dev.power.power_state.event = PM_EVENT_ON; 218 218 219 219 mutex_unlock(&us->dev_mutex); 220 220 return 0;