]> git.neil.brown.name Git - history.git/commitdiff
acpi sleep: demote sleep proc file creation.
authorPatrick Mochel <mochel@osdl.org>
Thu, 13 Feb 2003 06:38:03 +0000 (00:38 -0600)
committerPatrick Mochel <mochel@osdl.org>
Thu, 13 Feb 2003 06:38:03 +0000 (00:38 -0600)
- Make acpi_sleep_proc_init() a late_initcall(), and not called from
  acpi_sleep_init(). This guarantees that the acpi proc hierarchy is at
  least there when we create the dang file.

drivers/acpi/sleep/main.c
drivers/acpi/sleep/proc.c
drivers/acpi/sleep/sleep.h

index fb1bd6848c39bff46c92f568a76c6a064326b557..c02eb09293072723904e5e8508aa52a6c63283df 100644 (file)
@@ -270,8 +270,6 @@ static int __init acpi_sleep_init(void)
        }
        printk(")\n");
 
-       acpi_sleep_proc_init();
-
        return_VALUE(0);
 }
 
index 868851bb333fc17061768b3628dfd6cecc5292f0..1d5375b8a32383f060a88dbb996e80b6e34d80b2 100644 (file)
@@ -66,8 +66,8 @@ acpi_system_write_sleep (
        if (state < 1 || state > 4)
                goto Done;
 
-       if (!sleep_states[state])
-               return_VALUE(-ENODEV);
+       if (!sleep_states[state]) 
+               goto Done;
 
 #ifdef CONFIG_SOFTWARE_SUSPEND
        if (state == 4) {
@@ -375,7 +375,7 @@ static struct file_operations acpi_system_alarm_fops = {
 };
 
 
-int acpi_sleep_proc_init(void)
+static int acpi_sleep_proc_init(void)
 {
        struct proc_dir_entry   *entry = NULL;
 
@@ -392,3 +392,5 @@ int acpi_sleep_proc_init(void)
                entry->proc_fops = &acpi_system_alarm_fops;
        return 0;
 }
+
+late_initcall(acpi_sleep_proc_init);
index 805a212961a51693b2beed1fbd87568f58765c71..97b72323f35e6c54d491d783ef39e4422cc5327d 100644 (file)
@@ -3,11 +3,3 @@ extern u8 sleep_states[];
 
 extern acpi_status acpi_suspend (u32 state);
 
-#ifdef CONFIG_PROC_FS
-extern int acpi_sleep_proc_init(void);
-#else
-static inline int acpi_sleep_proc_init(void)
-{
-       return 0;
-}
-#endif