Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166378
b: refs/heads/master
c: bc3b077
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Sep 25, 2009
1 parent 9780e25 commit e289f50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 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: ccba2a36d74a9da815e597ac727cfd096fa8e750
refs/heads/master: bc3b07726aa288e2a5e60d9a1dd8188b3faa7385
32 changes: 15 additions & 17 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1171,29 +1171,27 @@ static void acpi_device_set_id(struct acpi_device *device, int type)
kfree(info);
}

static int acpi_device_set_context(struct acpi_device *device, int type)
static int acpi_device_set_context(struct acpi_device *device)
{
acpi_status status = AE_OK;
int result = 0;
acpi_status status;

/*
* Context
* -------
* Attach this 'struct acpi_device' to the ACPI object. This makes
* resolutions from handle->device very efficient. Note that we need
* to be careful with fixed-feature devices as they all attach to the
* root object.
* resolutions from handle->device very efficient. Fixed hardware
* devices have no handles, so we skip them.
*/
if (type != ACPI_BUS_TYPE_POWER_BUTTON &&
type != ACPI_BUS_TYPE_SLEEP_BUTTON) {
status = acpi_attach_data(device->handle,
acpi_bus_data_handler, device);
if (!device->handle)
return 0;

if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Error attaching device data\n");
result = -ENODEV;
}
}
return result;
status = acpi_attach_data(device->handle,
acpi_bus_data_handler, device);
if (ACPI_SUCCESS(status))
return 0;

printk(KERN_ERR PREFIX "Error attaching device data\n");
return -ENODEV;
}

static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
Expand Down Expand Up @@ -1338,7 +1336,7 @@ acpi_add_single_object(struct acpi_device **child,
goto end;
}

if ((result = acpi_device_set_context(device, type)))
if ((result = acpi_device_set_context(device)))
goto end;

result = acpi_device_register(device);
Expand Down

0 comments on commit e289f50

Please sign in to comment.