Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84145
b: refs/heads/master
c: 2073393
h: refs/heads/master
i:
  84143: 40fc190
v: v3
  • Loading branch information
Zhang Rui authored and Len Brown committed Feb 2, 2008
1 parent 29e01c1 commit 1f91060
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 702ed512de9c8a67a69a981c73b7337c2131f198
refs/heads/master: 207339398ecb0835331c748612898dad2a09fdec
25 changes: 25 additions & 0 deletions trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,31 @@ int acpi_bus_get_status(struct acpi_device *device)

EXPORT_SYMBOL(acpi_bus_get_status);

void acpi_bus_private_data_handler(acpi_handle handle,
u32 function, void *context)
{
return;
}
EXPORT_SYMBOL(acpi_bus_private_data_handler);

int acpi_bus_get_private_data(acpi_handle handle, void **data)
{
acpi_status status = AE_OK;

if (!*data)
return -EINVAL;

status = acpi_get_data(handle, acpi_bus_private_data_handler, data);
if (ACPI_FAILURE(status) || !*data) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
handle));
return -ENODEV;
}

return 0;
}
EXPORT_SYMBOL(acpi_bus_get_private_data);

/* --------------------------------------------------------------------------
Power Management
-------------------------------------------------------------------------- */
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
{
int trips = 0;
int result;
acpi_status status;
int i;

if (tz->trips.critical.flags.valid)
Expand Down Expand Up @@ -1129,6 +1130,15 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
if (result)
return result;

status = acpi_attach_data(tz->device->handle,
acpi_bus_private_data_handler,
tz->thermal_zone);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error attaching device data\n"));
return -ENODEV;
}

tz->tz_enabled = 1;

printk(KERN_INFO PREFIX "%s is registered as thermal_zone%d\n",
Expand All @@ -1142,6 +1152,7 @@ static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz)
sysfs_remove_link(&tz->thermal_zone->device.kobj, "device");
thermal_zone_device_unregister(tz->thermal_zone);
tz->thermal_zone = NULL;
acpi_detach_data(tz->device->handle, acpi_bus_private_data_handler);
}


Expand Down
2 changes: 2 additions & 0 deletions trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ struct acpi_bus_event {

extern struct kobject *acpi_kobj;
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
void acpi_bus_private_data_handler(acpi_handle, u32, void *);
int acpi_bus_get_private_data(acpi_handle, void **);
/*
* External Functions
*/
Expand Down

0 comments on commit 1f91060

Please sign in to comment.