diff options
Diffstat (limited to 'drivers/acpi/scan.c')
| -rw-r--r-- | drivers/acpi/scan.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index eb7a1ff224e7..1870223cb1a3 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -474,8 +474,8 @@ static int acpi_generic_hotplug_event(struct acpi_device *adev, u32 type) | |||
| 474 | dev_info(&adev->dev, "Eject disabled\n"); | 474 | dev_info(&adev->dev, "Eject disabled\n"); |
| 475 | return -EPERM; | 475 | return -EPERM; |
| 476 | } | 476 | } |
| 477 | acpi_evaluate_hotplug_ost(adev->handle, ACPI_NOTIFY_EJECT_REQUEST, | 477 | acpi_evaluate_ost(adev->handle, ACPI_NOTIFY_EJECT_REQUEST, |
| 478 | ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); | 478 | ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); |
| 479 | return acpi_scan_hot_remove(adev); | 479 | return acpi_scan_hot_remove(adev); |
| 480 | } | 480 | } |
| 481 | return -EINVAL; | 481 | return -EINVAL; |
| @@ -524,7 +524,7 @@ void acpi_device_hotplug(struct acpi_device *adev, u32 src) | |||
| 524 | ost_code = ACPI_OST_SC_SUCCESS; | 524 | ost_code = ACPI_OST_SC_SUCCESS; |
| 525 | 525 | ||
| 526 | err_out: | 526 | err_out: |
| 527 | acpi_evaluate_hotplug_ost(adev->handle, src, ost_code, NULL); | 527 | acpi_evaluate_ost(adev->handle, src, ost_code, NULL); |
| 528 | 528 | ||
| 529 | out: | 529 | out: |
| 530 | acpi_bus_put_acpi_device(adev); | 530 | acpi_bus_put_acpi_device(adev); |
| @@ -583,8 +583,8 @@ acpi_eject_store(struct device *d, struct device_attribute *attr, | |||
| 583 | return count; | 583 | return count; |
| 584 | 584 | ||
| 585 | put_device(&acpi_device->dev); | 585 | put_device(&acpi_device->dev); |
| 586 | acpi_evaluate_hotplug_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT, | 586 | acpi_evaluate_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT, |
| 587 | ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL); | 587 | ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL); |
| 588 | return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN; | 588 | return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN; |
| 589 | } | 589 | } |
| 590 | 590 | ||
| @@ -1757,6 +1757,20 @@ static bool acpi_ibm_smbus_match(acpi_handle handle) | |||
| 1757 | return false; | 1757 | return false; |
| 1758 | } | 1758 | } |
| 1759 | 1759 | ||
| 1760 | static bool acpi_object_is_system_bus(acpi_handle handle) | ||
| 1761 | { | ||
| 1762 | acpi_handle tmp; | ||
| 1763 | |||
| 1764 | if (ACPI_SUCCESS(acpi_get_handle(NULL, "\\_SB", &tmp)) && | ||
| 1765 | tmp == handle) | ||
| 1766 | return true; | ||
| 1767 | if (ACPI_SUCCESS(acpi_get_handle(NULL, "\\_TZ", &tmp)) && | ||
| 1768 | tmp == handle) | ||
| 1769 | return true; | ||
| 1770 | |||
| 1771 | return false; | ||
| 1772 | } | ||
| 1773 | |||
| 1760 | static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, | 1774 | static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, |
| 1761 | int device_type) | 1775 | int device_type) |
| 1762 | { | 1776 | { |
| @@ -1808,8 +1822,10 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, | |||
| 1808 | acpi_add_id(pnp, ACPI_DOCK_HID); | 1822 | acpi_add_id(pnp, ACPI_DOCK_HID); |
| 1809 | else if (acpi_ibm_smbus_match(handle)) | 1823 | else if (acpi_ibm_smbus_match(handle)) |
| 1810 | acpi_add_id(pnp, ACPI_SMBUS_IBM_HID); | 1824 | acpi_add_id(pnp, ACPI_SMBUS_IBM_HID); |
| 1811 | else if (list_empty(&pnp->ids) && handle == ACPI_ROOT_OBJECT) { | 1825 | else if (list_empty(&pnp->ids) && |
| 1812 | acpi_add_id(pnp, ACPI_BUS_HID); /* \_SB, LNXSYBUS */ | 1826 | acpi_object_is_system_bus(handle)) { |
| 1827 | /* \_SB, \_TZ, LNXSYBUS */ | ||
| 1828 | acpi_add_id(pnp, ACPI_BUS_HID); | ||
| 1813 | strcpy(pnp->device_name, ACPI_BUS_DEVICE_NAME); | 1829 | strcpy(pnp->device_name, ACPI_BUS_DEVICE_NAME); |
| 1814 | strcpy(pnp->device_class, ACPI_BUS_CLASS); | 1830 | strcpy(pnp->device_class, ACPI_BUS_CLASS); |
| 1815 | } | 1831 | } |
