Messages in this thread Patch in this message | | | From | Nigel Cunningham <> | Subject | [Suspend2][ 12/12] [Suspend2] Load and unload routines. | Date | Tue, 27 Jun 2006 14:38:43 +1000 |
| |
Add routines to register and deregister the encryption support and proc entries on load and unload.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
kernel/power/encryption.c | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/kernel/power/encryption.c b/kernel/power/encryption.c index 8f544ff..4d9091c 100644 --- a/kernel/power/encryption.c +++ b/kernel/power/encryption.c @@ -503,3 +503,36 @@ static struct suspend_module_ops suspend .read_chunk = suspend_encrypt_read_chunk, }; +/* ---- Registration ---- */ + +static __init int suspend_encrypt_load(void) +{ + int result; + int i, numfiles = sizeof(proc_params) / sizeof(struct suspend_proc_data); + + printk("Suspend2 Encryption Driver loading.\n"); + if (!(result = suspend_register_module(&suspend_encryption_ops))) { + for (i=0; i< numfiles; i++) + suspend_register_procfile(&proc_params[i]); + } else + printk("Suspend2 Encryption Driver unable to register!\n"); + return result; +} + +#ifdef MODULE +static __exit void suspend_compress_unload(void) +{ + printk("Suspend2 Encryption Driver unloading.\n"); + for (i=0; i< numfiles; i++) + suspend_unregister_procfile(&proc_params[i]); + suspend_unregister_module(&suspend_encryption_ops); +} + +module_init(suspend_encrypt_load); +module_exit(suspend_encrypt_unload); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Nigel Cunningham"); +MODULE_DESCRIPTION("Encryption Support for Suspend2"); +#else +late_initcall(suspend_encrypt_load); +#endif -- Nigel Cunningham nigel at suspend2 dot net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |