aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 17:45:04 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-01-12 17:45:04 -0500
commit25d412d932fb3289ae5b510845d523330b80bb71 (patch)
tree7234bf9bf03af4b0f1f40830169cd7219ef586ed /drivers/usb
parent98feb7cc61c50fe0fa36eeb994d5db527ca9e103 (diff)
parentc713cd7f2d799c50a0721bf51d178ea9567215dd (diff)
Merge branch 'acpi-hotplug'
* acpi-hotplug: ACPI / scan: ACPI device object sysfs attribute for _STA evaluation ACPI / hotplug / driver core: Handle containers in a special way ACPI / hotplug: Add demand_offline hotplug profile flag ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c ACPI / bind: Pass struct acpi_device pointer to acpi_bind_one() ACPI / bind: Rework struct acpi_bus_type ACPI / bind: Redefine acpi_preset_companion() ACPI / bind: Redefine acpi_get_child() PCI / ACPI: Use acpi_find_child_device() for child devices lookup ACPI / bind: Simplify child device lookups ACPI / scan: Use direct recurrence for device hierarchy walks ACPI: Introduce acpi_set_device_status() ACPI / hotplug: Drop unfinished global notification handling routines ACPI / hotplug: Rework generic code to handle suprise removals ACPI / hotplug: Move container-specific code out of the core ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug() ACPI / hotplug: Do not fail bus and device checks for disabled hotplug ACPI / scan: Add acpi_device objects for all device nodes in the namespace ACPI / scan: Define non-empty device removal handler
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/usb-acpi.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index 11c656976cb5..f0155a39aaa3 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -126,7 +126,7 @@ out:
126 return ret; 126 return ret;
127} 127}
128 128
129static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) 129static struct acpi_device *usb_acpi_find_companion(struct device *dev)
130{ 130{
131 struct usb_device *udev; 131 struct usb_device *udev;
132 acpi_handle *parent_handle; 132 acpi_handle *parent_handle;
@@ -168,16 +168,15 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
168 break; 168 break;
169 } 169 }
170 170
171 return -ENODEV; 171 return NULL;
172 } 172 }
173 173
174 /* root hub's parent is the usb hcd. */ 174 /* root hub's parent is the usb hcd. */
175 parent_handle = ACPI_HANDLE(dev->parent); 175 return acpi_find_child_device(ACPI_COMPANION(dev->parent),
176 *handle = acpi_get_child(parent_handle, udev->portnum); 176 udev->portnum, false);
177 if (!*handle)
178 return -ENODEV;
179 return 0;
180 } else if (is_usb_port(dev)) { 177 } else if (is_usb_port(dev)) {
178 struct acpi_device *adev = NULL;
179
181 sscanf(dev_name(dev), "port%d", &port_num); 180 sscanf(dev_name(dev), "port%d", &port_num);
182 /* Get the struct usb_device point of port's hub */ 181 /* Get the struct usb_device point of port's hub */
183 udev = to_usb_device(dev->parent->parent); 182 udev = to_usb_device(dev->parent->parent);
@@ -193,26 +192,27 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
193 192
194 raw_port_num = usb_hcd_find_raw_port_number(hcd, 193 raw_port_num = usb_hcd_find_raw_port_number(hcd,
195 port_num); 194 port_num);
196 *handle = acpi_get_child(ACPI_HANDLE(&udev->dev), 195 adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev),
197 raw_port_num); 196 raw_port_num, false);
198 if (!*handle) 197 if (!adev)
199 return -ENODEV; 198 return NULL;
200 } else { 199 } else {
201 parent_handle = 200 parent_handle =
202 usb_get_hub_port_acpi_handle(udev->parent, 201 usb_get_hub_port_acpi_handle(udev->parent,
203 udev->portnum); 202 udev->portnum);
204 if (!parent_handle) 203 if (!parent_handle)
205 return -ENODEV; 204 return NULL;
206 205
207 *handle = acpi_get_child(parent_handle, port_num); 206 acpi_bus_get_device(parent_handle, &adev);
208 if (!*handle) 207 adev = acpi_find_child_device(adev, port_num, false);
209 return -ENODEV; 208 if (!adev)
209 return NULL;
210 } 210 }
211 usb_acpi_check_port_connect_type(udev, *handle, port_num); 211 usb_acpi_check_port_connect_type(udev, adev->handle, port_num);
212 } else 212 return adev;
213 return -ENODEV; 213 }
214 214
215 return 0; 215 return NULL;
216} 216}
217 217
218static bool usb_acpi_bus_match(struct device *dev) 218static bool usb_acpi_bus_match(struct device *dev)
@@ -223,7 +223,7 @@ static bool usb_acpi_bus_match(struct device *dev)
223static struct acpi_bus_type usb_acpi_bus = { 223static struct acpi_bus_type usb_acpi_bus = {
224 .name = "USB", 224 .name = "USB",
225 .match = usb_acpi_bus_match, 225 .match = usb_acpi_bus_match,
226 .find_device = usb_acpi_find_device, 226 .find_companion = usb_acpi_find_companion,
227}; 227};
228 228
229int usb_acpi_register(void) 229int usb_acpi_register(void)