Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127349
b: refs/heads/master
c: 56ee325
h: refs/heads/master
i:
  127347: e757a28
v: v3
  • Loading branch information
Matthew Garrett authored and Jesse Barnes committed Jan 7, 2009
1 parent 36eaef2 commit b46d8fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86d8698027fd30cc067d2aeeb1e3603d43c83df0
refs/heads/master: 56ee325e25a0f76fc3267872867b3d70af179aad
32 changes: 17 additions & 15 deletions trunk/drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type, void *contex
* Ejectable slot should satisfy at least these conditions:
*
* 1. has _ADR method
* 2. has _EJ0 method
* 2. has _EJ0 method or _RMV method
*
* optionally
*
Expand All @@ -87,18 +87,25 @@ static int is_ejectable(acpi_handle handle)
{
acpi_status status;
acpi_handle tmp;
unsigned long long removable;

status = acpi_get_handle(handle, "_ADR", &tmp);
if (ACPI_FAILURE(status)) {
if (ACPI_FAILURE(status))
return 0;
}

status = acpi_get_handle(handle, "_EJ0", &tmp);
if (ACPI_FAILURE(status)) {
return 0;
if (ACPI_SUCCESS(status))
return 1;

status = acpi_get_handle(handle, "_RMV", &tmp);
if (ACPI_SUCCESS(status)) {
status = acpi_evaluate_integer(handle, "_RMV", NULL,
&removable);
if (ACPI_SUCCESS(status) && removable)
return 1;
}

return 1;
return 0;
}


Expand Down Expand Up @@ -185,16 +192,10 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
unsigned long long adr, sun;
int device, function, retval;

status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);

if (ACPI_FAILURE(status))
return AE_OK;

status = acpi_get_handle(handle, "_EJ0", &tmp);

if (ACPI_FAILURE(status) && !(is_dock_device(handle)))
if (!is_ejectable(handle) && !is_dock_device(handle))
return AE_OK;

acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
device = (adr >> 16) & 0xffff;
function = adr & 0xffff;

Expand All @@ -205,7 +206,8 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
INIT_LIST_HEAD(&newfunc->sibling);
newfunc->handle = handle;
newfunc->function = function;
if (ACPI_SUCCESS(status))

if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp)))
newfunc->flags = FUNC_HAS_EJ0;

if (ACPI_SUCCESS(acpi_get_handle(handle, "_STA", &tmp)))
Expand Down

0 comments on commit b46d8fc

Please sign in to comment.