]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/executer/exfield.c
r8169: revert "read MAC address from EEPROM on init"
[linux-2.6-omap-h63xx.git] / drivers / acpi / executer / exfield.c
index e66b367c4fb67bc905bea5b1d9d880f730adf778..3e440d84226a4e85aea18a5b49156145e1bfbfd7 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -122,7 +122,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
                                                             buffer.pointer),
                                               ACPI_READ | (obj_desc->field.
                                                            attribute << 16));
-               acpi_ex_release_global_lock();
+               acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
                goto exit;
        }
 
@@ -177,7 +177,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
        /* Read from the field */
 
        status = acpi_ex_extract_from_field(obj_desc, buffer, (u32) length);
-       acpi_ex_release_global_lock();
+       acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
       exit:
        if (ACPI_FAILURE(status)) {
@@ -210,9 +210,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
 {
        acpi_status status;
        u32 length;
-       u32 required_length;
        void *buffer;
-       void *new_buffer;
        union acpi_operand_object *buffer_desc;
 
        ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc);
@@ -284,7 +282,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
                                               (acpi_integer *) buffer,
                                               ACPI_WRITE | (obj_desc->field.
                                                             attribute << 16));
-               acpi_ex_release_global_lock();
+               acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
                *result_desc = buffer_desc;
                return_ACPI_STATUS(status);
@@ -312,35 +310,6 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
                return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
        }
 
-       /*
-        * We must have a buffer that is at least as long as the field
-        * we are writing to.  This is because individual fields are
-        * indivisible and partial writes are not supported -- as per
-        * the ACPI specification.
-        */
-       new_buffer = NULL;
-       required_length =
-           ACPI_ROUND_BITS_UP_TO_BYTES(obj_desc->common_field.bit_length);
-
-       if (length < required_length) {
-
-               /* We need to create a new buffer */
-
-               new_buffer = ACPI_ALLOCATE_ZEROED(required_length);
-               if (!new_buffer) {
-                       return_ACPI_STATUS(AE_NO_MEMORY);
-               }
-
-               /*
-                * Copy the original data to the new buffer, starting
-                * at Byte zero.  All unused (upper) bytes of the
-                * buffer will be 0.
-                */
-               ACPI_MEMCPY((char *)new_buffer, (char *)buffer, length);
-               buffer = new_buffer;
-               length = required_length;
-       }
-
        ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
                          "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n",
                          source_desc,
@@ -364,13 +333,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
        /* Write to the field */
 
        status = acpi_ex_insert_into_field(obj_desc, buffer, length);
-       acpi_ex_release_global_lock();
-
-       /* Free temporary buffer if we used one */
-
-       if (new_buffer) {
-               ACPI_FREE(new_buffer);
-       }
+       acpi_ex_release_global_lock(obj_desc->common_field.field_flags);
 
        return_ACPI_STATUS(status);
 }