]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/power.c
ext4: fix online resize with mballoc
[linux-2.6-omap-h63xx.git] / drivers / acpi / power.c
index 76bf6d90c700efac7905d6167680915ca50e1498..81e4f081a4aefd2d53d3004fae15d0935610bb90 100644 (file)
@@ -93,6 +93,7 @@ struct acpi_power_resource {
 static struct list_head acpi_power_resource_list;
 
 static const struct file_operations acpi_power_fops = {
+       .owner = THIS_MODULE,
        .open = acpi_power_open_fs,
        .read = seq_read,
        .llseek = seq_lseek,
@@ -121,7 +122,7 @@ acpi_power_get_context(acpi_handle handle,
        }
 
        *resource = acpi_driver_data(device);
-       if (!resource)
+       if (!*resource)
                return -ENODEV;
 
        return 0;
@@ -543,15 +544,11 @@ static int acpi_power_add_fs(struct acpi_device *device)
        }
 
        /* 'status' [R] */
-       entry = create_proc_entry(ACPI_POWER_FILE_STATUS,
-                                 S_IRUGO, acpi_device_dir(device));
+       entry = proc_create_data(ACPI_POWER_FILE_STATUS,
+                                S_IRUGO, acpi_device_dir(device),
+                                &acpi_power_fops, acpi_driver_data(device));
        if (!entry)
                return -EIO;
-       else {
-               entry->proc_fops = &acpi_power_fops;
-               entry->data = acpi_driver_data(device);
-       }
-
        return 0;
 }