[RFC PATCH 07/15] usbcore: pm_runtime honor children

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that ports are in the hierarchy above endpoints we can take
advantage of the automatic power management of the device tree.

There is now no need to power manage the hub in
usb_port_runtime_{suspend|resume}

Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
---
 drivers/usb/core/hub.c  |    2 --
 drivers/usb/core/port.c |    6 ------
 2 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index b78eb4cdf5ed..e06a457094fd 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1637,7 +1637,6 @@ static void hub_disconnect(struct usb_interface *intf)
 	kfree(hub->status);
 	kfree(hub->buffer);
 
-	pm_suspend_ignore_children(&intf->dev, false);
 	kref_put(&hub->kref, hub_release);
 }
 
@@ -1740,7 +1739,6 @@ descriptor_error:
 
 	usb_set_intfdata (intf, hub);
 	intf->needs_remote_wakeup = 1;
-	pm_suspend_ignore_children(&intf->dev, true);
 
 	if (hdev->speed == USB_SPEED_HIGH)
 		highspeed_hubs++;
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index 259ed86f56d2..3c20cea08d50 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -88,7 +88,6 @@ static int usb_port_runtime_poweron(struct device *dev)
 {
 	struct usb_port *port_dev = to_usb_port(dev);
 	struct usb_device *hdev = to_usb_device(dev->parent->parent);
-	struct usb_interface *intf = to_usb_interface(dev->parent);
 	struct usb_hub *hub = usb_hub_to_struct_hub(hdev);
 	int port1 = port_dev->portnum;
 	int retval;
@@ -104,7 +103,6 @@ static int usb_port_runtime_poweron(struct device *dev)
 	if (is_power_policy_on(port_dev))
 		return 0;
 
-	usb_autopm_get_interface(intf);
 	set_bit(port1, hub->busy_bits);
 
 	retval = usb_hub_set_port_power(hdev, hub, port1, true);
@@ -124,7 +122,6 @@ static int usb_port_runtime_poweron(struct device *dev)
 	}
 
 	clear_bit(port1, hub->busy_bits);
-	usb_autopm_put_interface(intf);
 	return retval;
 }
 
@@ -132,7 +129,6 @@ static int usb_port_runtime_poweroff(struct device *dev)
 {
 	struct usb_port *port_dev = to_usb_port(dev);
 	struct usb_device *hdev = to_usb_device(dev->parent->parent);
-	struct usb_interface *intf = to_usb_interface(dev->parent);
 	struct usb_hub *hub = usb_hub_to_struct_hub(hdev);
 	int port1 = port_dev->portnum;
 	int retval;
@@ -143,13 +139,11 @@ static int usb_port_runtime_poweroff(struct device *dev)
 	if (is_power_policy_on(port_dev))
 		return 0;
 
-	usb_autopm_get_interface(intf);
 	set_bit(port1, hub->busy_bits);
 	retval = usb_hub_set_port_power(hdev, hub, port1, false);
 	usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION);
 	usb_clear_port_feature(hdev, port1,	USB_PORT_FEAT_C_ENABLE);
 	clear_bit(port1, hub->busy_bits);
-	usb_autopm_put_interface(intf);
 	return retval;
 }
 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux