Skip to content

Commit

Permalink
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: ACPI_DOCK: Initialize the atomic notifier list
  ACPI: acpi_os_allocate() fixes
  ACPI: SBS: fix initialization, sem2mutex
  ACPI: add 'const' to several ACPI file_operations
  ACPI: delete some defaults from ACPI Kconfig
  ACPI: "Device `[%s]' is not power manageable" make message debug only
  ACPI: ACPI_DOCK Kconfig
  Revert "Revert "ACPI: dock driver""
  ACPI: acpi_os_get_thread_id() returns current
  ACPI: ACPICA 20060707
  • Loading branch information
Linus Torvalds committed Jul 10, 2006
2 parents 90ca9a2 + 0466684 commit c80dc60
Show file tree
Hide file tree
Showing 52 changed files with 1,086 additions and 228 deletions.
7 changes: 7 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ config ACPI_FAN
This driver adds support for ACPI fan devices, allowing user-mode
applications to perform basic fan control (on, off, status).

config ACPI_DOCK
tristate "Dock"
depends on EXPERIMENTAL
help
This driver adds support for ACPI controlled docking stations

config ACPI_PROCESSOR
tristate "Processor"
default y
Expand Down Expand Up @@ -206,6 +212,7 @@ config ACPI_IBM
config ACPI_IBM_DOCK
bool "Legacy Docking Station Support"
depends on ACPI_IBM
depends on ACPI_DOCK=n
default n
---help---
Allows the ibm_acpi driver to handle docking station events.
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o
obj-$(CONFIG_ACPI_BUTTON) += button.o
obj-$(CONFIG_ACPI_EC) += ec.o
obj-$(CONFIG_ACPI_FAN) += fan.o
obj-$(CONFIG_ACPI_DOCK) += dock.o
obj-$(CONFIG_ACPI_VIDEO) += video.o
obj-$(CONFIG_ACPI_HOTKEY) += hotkey.o
obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct acpi_ac {
unsigned long state;
};

static struct file_operations acpi_ac_fops = {
static const struct file_operations acpi_ac_fops = {
.open = acpi_ac_open_fs,
.read = seq_read,
.llseek = seq_lseek,
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,23 +557,23 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
return single_open(file, acpi_battery_read_alarm, PDE(inode)->data);
}

static struct file_operations acpi_battery_info_ops = {
static const struct file_operations acpi_battery_info_ops = {
.open = acpi_battery_info_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.owner = THIS_MODULE,
};

static struct file_operations acpi_battery_state_ops = {
static const struct file_operations acpi_battery_state_ops = {
.open = acpi_battery_state_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.owner = THIS_MODULE,
};

static struct file_operations acpi_battery_alarm_ops = {
static const struct file_operations acpi_battery_alarm_ops = {
.open = acpi_battery_alarm_open_fs,
.read = seq_read,
.write = acpi_battery_write_alarm,
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ int acpi_bus_set_power(acpi_handle handle, int state)
/* Make sure this is a valid target state */

if (!device->flags.power_manageable) {
printk(KERN_DEBUG "Device `[%s]' is not power manageable",
device->kobj.name);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device `[%s]' is not power manageable",
device->kobj.name));
return -ENODEV;
}
/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ struct acpi_button {
unsigned long pushed;
};

static struct file_operations acpi_button_info_fops = {
static const struct file_operations acpi_button_info_fops = {
.open = acpi_button_info_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static struct file_operations acpi_button_state_fops = {
static const struct file_operations acpi_button_state_fops = {
.open = acpi_button_state_open_fs,
.read = seq_read,
.llseek = seq_lseek,
Expand Down
46 changes: 14 additions & 32 deletions drivers/acpi/cm_sbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,50 +39,43 @@ ACPI_MODULE_NAME("cm_sbs")
static struct proc_dir_entry *acpi_ac_dir;
static struct proc_dir_entry *acpi_battery_dir;

static struct semaphore cm_sbs_sem;
static DEFINE_MUTEX(cm_sbs_mutex);

static int lock_ac_dir_cnt = 0;
static int lock_battery_dir_cnt = 0;
static int lock_ac_dir_cnt;
static int lock_battery_dir_cnt;

struct proc_dir_entry *acpi_lock_ac_dir(void)
{

down(&cm_sbs_sem);
if (!acpi_ac_dir) {
mutex_lock(&cm_sbs_mutex);
if (!acpi_ac_dir)
acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
}
if (acpi_ac_dir) {
lock_ac_dir_cnt++;
} else {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Cannot create %s\n", ACPI_AC_CLASS));
}
up(&cm_sbs_sem);
mutex_unlock(&cm_sbs_mutex);
return acpi_ac_dir;
}

EXPORT_SYMBOL(acpi_lock_ac_dir);

void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
{

down(&cm_sbs_sem);
if (acpi_ac_dir_param) {
mutex_lock(&cm_sbs_mutex);
if (acpi_ac_dir_param)
lock_ac_dir_cnt--;
}
if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
acpi_ac_dir = 0;
}
up(&cm_sbs_sem);
mutex_unlock(&cm_sbs_mutex);
}

EXPORT_SYMBOL(acpi_unlock_ac_dir);

struct proc_dir_entry *acpi_lock_battery_dir(void)
{

down(&cm_sbs_sem);
mutex_lock(&cm_sbs_mutex);
if (!acpi_battery_dir) {
acpi_battery_dir =
proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
Expand All @@ -93,39 +86,28 @@ struct proc_dir_entry *acpi_lock_battery_dir(void)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Cannot create %s\n", ACPI_BATTERY_CLASS));
}
up(&cm_sbs_sem);
mutex_unlock(&cm_sbs_mutex);
return acpi_battery_dir;
}

EXPORT_SYMBOL(acpi_lock_battery_dir);

void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
{

down(&cm_sbs_sem);
if (acpi_battery_dir_param) {
mutex_lock(&cm_sbs_mutex);
if (acpi_battery_dir_param)
lock_battery_dir_cnt--;
}
if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param
&& acpi_battery_dir) {
remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
acpi_battery_dir = 0;
}
up(&cm_sbs_sem);
mutex_unlock(&cm_sbs_mutex);
return;
}

EXPORT_SYMBOL(acpi_unlock_battery_dir);

static int __init acpi_cm_sbs_init(void)
{

if (acpi_disabled)
return 0;

init_MUTEX(&cm_sbs_sem);

return 0;
}

subsys_initcall(acpi_cm_sbs_init);
10 changes: 0 additions & 10 deletions drivers/acpi/dispatcher/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@ acpi_ds_init_one_object(acpi_handle obj_handle,

case ACPI_TYPE_METHOD:

/*
* Set the execution data width (32 or 64) based upon the
* revision number of the parent ACPI table.
* TBD: This is really for possible future support of integer width
* on a per-table basis. Currently, we just use a global for the width.
*/
if (info->table_desc->pointer->revision == 1) {
node->flags |= ANOBJ_DATA_WIDTH_32;
}

info->method_count++;
break;

Expand Down
23 changes: 4 additions & 19 deletions drivers/acpi/dispatcher/dsmethod.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ acpi_ds_create_method_mutex(union acpi_operand_object *method_desc)
union acpi_operand_object *mutex_desc;
acpi_status status;

ACPI_FUNCTION_NAME(ds_create_method_mutex);
ACPI_FUNCTION_TRACE(ds_create_method_mutex);

/* Create the new mutex object */

Expand Down Expand Up @@ -493,7 +493,7 @@ acpi_ds_restart_control_method(struct acpi_walk_state *walk_state,

ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"****Restart [%4.4s] Op %p ReturnValueFromCallee %p\n",
(char *)&walk_state->method_node->name,
acpi_ut_get_node_name(walk_state->method_node),
walk_state->method_call_op, return_desc));

ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
Expand Down Expand Up @@ -610,6 +610,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,

acpi_os_release_mutex(method_desc->method.mutex->mutex.
os_mutex);
method_desc->method.mutex->mutex.owner_thread = NULL;
}
}

Expand All @@ -620,27 +621,11 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
*/
method_node = walk_state->method_node;

/* Lock namespace for possible update */

status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) {
return_VOID;
}

/*
* Delete any namespace entries created immediately underneath
* the method
*/
if (method_node && method_node->child) {
acpi_ns_delete_namespace_subtree(method_node);
}

/*
* Delete any namespace entries created anywhere else within
* Delete any namespace objects created anywhere within
* the namespace by the execution of this method
*/
acpi_ns_delete_namespace_by_owner(method_desc->method.owner_id);
status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
}

/* Decrement the thread count on the method */
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/dispatcher/dswexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
case AML_CLASS_EXECUTE:
case AML_CLASS_CREATE:
/*
* Most operators with arguments.
* Most operators with arguments (except create_xxx_field operators)
* Start a new result/operand state
*/
if (walk_state->opcode != AML_CREATE_FIELD_OP) {
if (walk_state->op_info->object_type != ACPI_TYPE_BUFFER_FIELD) {
status = acpi_ds_result_stack_push(walk_state);
}
break;
Expand Down
Loading

0 comments on commit c80dc60

Please sign in to comment.