]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/ec.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6-omap-h63xx.git] / drivers / acpi / ec.c
index 4a909bfb805cff49387cf1ef71f9efb6da63d569..743ce27fa0bbf2915c78f4d18fdefecb1fdf133a 100644 (file)
@@ -92,7 +92,7 @@ static struct acpi_driver acpi_ec_driver = {
 };
 
 /* If we find an EC via the ECDT, we need to keep a ptr to its context */
-struct acpi_ec {
+static struct acpi_ec {
        acpi_handle handle;
        unsigned long uid;
        unsigned long gpe;
@@ -424,7 +424,7 @@ static void acpi_ec_gpe_query(void *ec_cxt)
 
        snprintf(object_name, 8, "_Q%2.2X", value);
 
-       printk(KERN_INFO PREFIX "evaluating %s\n", object_name);
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s", object_name));
 
        acpi_evaluate_object(ec->handle, object_name, NULL, NULL);
 }
@@ -624,10 +624,9 @@ static int acpi_ec_add(struct acpi_device *device)
        if (!device)
                return -EINVAL;
 
-       ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
+       ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec)
                return -ENOMEM;
-       memset(ec, 0, sizeof(struct acpi_ec));
 
        ec->handle = device->handle;
        ec->uid = -1;
@@ -848,12 +847,11 @@ static int __init acpi_ec_fake_ecdt(void)
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Try to make an fake ECDT"));
 
-       ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
+       ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec_ecdt) {
                ret = -ENOMEM;
                goto error;
        }
-       memset(ec_ecdt, 0, sizeof(struct acpi_ec));
 
        status = acpi_get_devices(ACPI_EC_HID,
                                  acpi_fake_ecdt_callback, NULL, NULL);
@@ -874,9 +872,8 @@ static int __init acpi_ec_get_real_ecdt(void)
        acpi_status status;
        struct acpi_table_ecdt *ecdt_ptr;
 
-       status = acpi_get_firmware_table("ECDT", 1, ACPI_LOGICAL_ADDRESSING,
-                                        (struct acpi_table_header **)
-                                        &ecdt_ptr);
+       status = acpi_get_table(ACPI_SIG_ECDT, 1,
+                               (struct acpi_table_header **)&ecdt_ptr);
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
@@ -885,23 +882,22 @@ static int __init acpi_ec_get_real_ecdt(void)
        /*
         * Generate a temporary ec context to use until the namespace is scanned
         */
-       ec_ecdt = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
+       ec_ecdt = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL);
        if (!ec_ecdt)
                return -ENOMEM;
-       memset(ec_ecdt, 0, sizeof(struct acpi_ec));
 
        mutex_init(&ec_ecdt->lock);
        if (acpi_ec_mode == EC_INTR) {
                init_waitqueue_head(&ec_ecdt->wait);
        }
-       ec_ecdt->command_addr = ecdt_ptr->ec_control.address;
-       ec_ecdt->data_addr = ecdt_ptr->ec_data.address;
-       ec_ecdt->gpe = ecdt_ptr->gpe_bit;
+       ec_ecdt->command_addr = ecdt_ptr->control.address;
+       ec_ecdt->data_addr = ecdt_ptr->data.address;
+       ec_ecdt->gpe = ecdt_ptr->gpe;
        /* use the GL just to be safe */
        ec_ecdt->global_lock = TRUE;
        ec_ecdt->uid = ecdt_ptr->uid;
 
-       status = acpi_get_handle(NULL, ecdt_ptr->ec_id, &ec_ecdt->handle);
+       status = acpi_get_handle(NULL, ecdt_ptr->id, &ec_ecdt->handle);
        if (ACPI_FAILURE(status)) {
                goto error;
        }
@@ -1019,8 +1015,8 @@ static int __init acpi_ec_set_intr_mode(char *str)
                acpi_ec_mode = EC_POLL;
        }
        acpi_ec_driver.ops.add = acpi_ec_add;
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "EC %s mode.\n",
-                         intr ? "interrupt" : "polling"));
+       printk(KERN_NOTICE PREFIX "%s mode.\n",
+                         intr ? "interrupt" : "polling");
 
        return 1;
 }