summaryrefslogtreecommitdiff
path: root/drivers/usb/core/port.c
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-01-23 00:26:27 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-25 22:07:59 +0400
commit88bb965ed711e8a5984e70208ebc901a6ff4141f (patch)
treefa02381576bc90a91ffc8f62c6a4e7261f641a3a /drivers/usb/core/port.c
parent8eae0fb7efa99d55afa9e94ce95d101af0830ca6 (diff)
downloadlinux-88bb965ed711e8a5984e70208ebc901a6ff4141f.tar.xz
usb: Register usb port's acpi power resources
This patch is to register usb port's acpi power resources. Create link between usb port device and its acpi power resource. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/port.c')
-rw-r--r--drivers/usb/core/port.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
index fe5959fc021b..153e799e7320 100644
--- a/drivers/usb/core/port.c
+++ b/drivers/usb/core/port.c
@@ -66,6 +66,7 @@ static void usb_port_device_release(struct device *dev)
{
struct usb_port *port_dev = to_usb_port(dev);
+ usb_acpi_unregister_power_resources(dev);
kfree(port_dev);
}
@@ -95,6 +96,10 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1)
if (retval)
goto error_register;
+ retval = usb_acpi_register_power_resources(&port_dev->dev);
+ if (retval && retval != -ENODEV)
+ dev_warn(&port_dev->dev, "the port can't register its ACPI power resource.\n");
+
return 0;
error_register: