Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32033
b: refs/heads/master
c: 2df8386
h: refs/heads/master
i:
  32031: e3f0659
v: v3
  • Loading branch information
Karol Kozimor authored and Len Brown committed Jul 1, 2006
1 parent c8dd6c8 commit 5db7f00
Show file tree
Hide file tree
Showing 12 changed files with 372 additions and 220 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: b2f71bade430d468398167d696731bf770de2db8
refs/heads/master: 2df8386cec47520b76822cb39d96709f5d353cf8
14 changes: 8 additions & 6 deletions trunk/drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static struct acpi_driver acpi_ac_driver = {
};

struct acpi_ac {
struct acpi_device * device;
acpi_handle handle;
unsigned long state;
};

Expand All @@ -88,7 +88,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
if (!ac)
return -EINVAL;

status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state);
status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
ac->state = ACPI_AC_STATUS_UNKNOWN;
Expand Down Expand Up @@ -191,7 +191,9 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
if (!ac)
return;

device = ac->device;
if (acpi_bus_get_device(ac->handle, &device))
return;

switch (event) {
case ACPI_AC_NOTIFY_STATUS:
acpi_ac_get_state(ac);
Expand Down Expand Up @@ -221,7 +223,7 @@ static int acpi_ac_add(struct acpi_device *device)
return -ENOMEM;
memset(ac, 0, sizeof(struct acpi_ac));

ac->device = device;
ac->handle = device->handle;
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_AC_CLASS);
acpi_driver_data(device) = ac;
Expand All @@ -234,7 +236,7 @@ static int acpi_ac_add(struct acpi_device *device)
if (result)
goto end;

status = acpi_install_notify_handler(device->handle,
status = acpi_install_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
ac);
if (ACPI_FAILURE(status)) {
Expand Down Expand Up @@ -266,7 +268,7 @@ static int acpi_ac_remove(struct acpi_device *device, int type)

ac = (struct acpi_ac *)acpi_driver_data(device);

status = acpi_remove_notify_handler(device->handle,
status = acpi_remove_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify);

acpi_ac_remove_fs(device);
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct acpi_memory_info {
};

struct acpi_memory_device {
struct acpi_device * device;
acpi_handle handle;
unsigned int state; /* State of the memory device */
struct list_head res_list;
};
Expand Down Expand Up @@ -129,7 +129,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
struct acpi_memory_info *info, *n;


status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS,
acpi_memory_get_resource, mem_device);
if (ACPI_FAILURE(status)) {
list_for_each_entry_safe(info, n, &mem_device->res_list, list)
Expand Down Expand Up @@ -192,7 +192,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)


/* Get device present/absent information from the _STA */
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
NULL, &current_status)))
return -ENODEV;
/*
Expand Down Expand Up @@ -222,7 +222,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
return result;
}

node = acpi_get_node(mem_device->device->handle);
node = acpi_get_node(mem_device->handle);
/*
* Tell the VM there is more memory here...
* Note: Assume that this function returns zero on success
Expand Down Expand Up @@ -269,7 +269,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
arg_list.pointer = &arg;
arg.type = ACPI_TYPE_INTEGER;
arg.integer.value = 1;
status = acpi_evaluate_object(mem_device->device->handle,
status = acpi_evaluate_object(mem_device->handle,
"_EJ0", &arg_list, NULL);
/* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) {
Expand All @@ -278,7 +278,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
}

/* Evalute _STA to check if the device is disabled */
status = acpi_evaluate_integer(mem_device->device->handle, "_STA",
status = acpi_evaluate_integer(mem_device->handle, "_STA",
NULL, &current_status);
if (ACPI_FAILURE(status))
return -ENODEV;
Expand Down Expand Up @@ -398,7 +398,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
memset(mem_device, 0, sizeof(struct acpi_memory_device));

INIT_LIST_HEAD(&mem_device->res_list);
mem_device->device = device;
mem_device->handle = device->handle;
sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
acpi_driver_data(device) = mem_device;
Expand Down
Loading

0 comments on commit 5db7f00

Please sign in to comment.