linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / acpi / event.c
index 959a893..2dbb1b0 100644 (file)
@@ -48,17 +48,18 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
        static int chars_remaining = 0;
        static char *ptr;
 
+       ACPI_FUNCTION_TRACE("acpi_system_read_event");
 
        if (!chars_remaining) {
                memset(&event, 0, sizeof(struct acpi_bus_event));
 
                if ((file->f_flags & O_NONBLOCK)
                    && (list_empty(&acpi_bus_event_list)))
-                       return -EAGAIN;
+                       return_VALUE(-EAGAIN);
 
                result = acpi_bus_receive_event(&event);
                if (result)
-                       return result;
+                       return_VALUE(result);
 
                chars_remaining = sprintf(str, "%s %s %08x %08x\n",
                                          event.device_class ? event.
@@ -74,13 +75,13 @@ acpi_system_read_event(struct file *file, char __user * buffer, size_t count,
        }
 
        if (copy_to_user(buffer, ptr, count))
-               return -EFAULT;
+               return_VALUE(-EFAULT);
 
        *ppos += count;
        chars_remaining -= count;
        ptr += count;
 
-       return count;
+       return_VALUE(count);
 }
 
 static int acpi_system_close_event(struct inode *inode, struct file *file)
@@ -99,7 +100,7 @@ static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait)
        return 0;
 }
 
-static const struct file_operations acpi_system_event_ops = {
+static struct file_operations acpi_system_event_ops = {
        .open = acpi_system_open_event,
        .read = acpi_system_read_event,
        .release = acpi_system_close_event,
@@ -111,18 +112,22 @@ static int __init acpi_event_init(void)
        struct proc_dir_entry *entry;
        int error = 0;
 
+       ACPI_FUNCTION_TRACE("acpi_event_init");
 
        if (acpi_disabled)
-               return 0;
+               return_VALUE(0);
 
        /* 'event' [R] */
        entry = create_proc_entry("event", S_IRUSR, acpi_root_dir);
        if (entry)
                entry->proc_fops = &acpi_system_event_ops;
        else {
-               error = -ENODEV;
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "Unable to create '%s' proc fs entry\n",
+                                 "event"));
+               error = -EFAULT;
        }
-       return error;
+       return_VALUE(error);
 }
 
 subsys_initcall(acpi_event_init);