mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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
This commit is contained in:
commit
25d412d932
28 changed files with 654 additions and 629 deletions
|
|
@ -126,7 +126,7 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
|
||||
static struct acpi_device *usb_acpi_find_companion(struct device *dev)
|
||||
{
|
||||
struct usb_device *udev;
|
||||
acpi_handle *parent_handle;
|
||||
|
|
@ -168,16 +168,15 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
|
|||
break;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* root hub's parent is the usb hcd. */
|
||||
parent_handle = ACPI_HANDLE(dev->parent);
|
||||
*handle = acpi_get_child(parent_handle, udev->portnum);
|
||||
if (!*handle)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
return acpi_find_child_device(ACPI_COMPANION(dev->parent),
|
||||
udev->portnum, false);
|
||||
} else if (is_usb_port(dev)) {
|
||||
struct acpi_device *adev = NULL;
|
||||
|
||||
sscanf(dev_name(dev), "port%d", &port_num);
|
||||
/* Get the struct usb_device point of port's hub */
|
||||
udev = to_usb_device(dev->parent->parent);
|
||||
|
|
@ -193,26 +192,27 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle)
|
|||
|
||||
raw_port_num = usb_hcd_find_raw_port_number(hcd,
|
||||
port_num);
|
||||
*handle = acpi_get_child(ACPI_HANDLE(&udev->dev),
|
||||
raw_port_num);
|
||||
if (!*handle)
|
||||
return -ENODEV;
|
||||
adev = acpi_find_child_device(ACPI_COMPANION(&udev->dev),
|
||||
raw_port_num, false);
|
||||
if (!adev)
|
||||
return NULL;
|
||||
} else {
|
||||
parent_handle =
|
||||
usb_get_hub_port_acpi_handle(udev->parent,
|
||||
udev->portnum);
|
||||
if (!parent_handle)
|
||||
return -ENODEV;
|
||||
return NULL;
|
||||
|
||||
*handle = acpi_get_child(parent_handle, port_num);
|
||||
if (!*handle)
|
||||
return -ENODEV;
|
||||
acpi_bus_get_device(parent_handle, &adev);
|
||||
adev = acpi_find_child_device(adev, port_num, false);
|
||||
if (!adev)
|
||||
return NULL;
|
||||
}
|
||||
usb_acpi_check_port_connect_type(udev, *handle, port_num);
|
||||
} else
|
||||
return -ENODEV;
|
||||
usb_acpi_check_port_connect_type(udev, adev->handle, port_num);
|
||||
return adev;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool usb_acpi_bus_match(struct device *dev)
|
||||
|
|
@ -223,7 +223,7 @@ static bool usb_acpi_bus_match(struct device *dev)
|
|||
static struct acpi_bus_type usb_acpi_bus = {
|
||||
.name = "USB",
|
||||
.match = usb_acpi_bus_match,
|
||||
.find_device = usb_acpi_find_device,
|
||||
.find_companion = usb_acpi_find_companion,
|
||||
};
|
||||
|
||||
int usb_acpi_register(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue