Messages in this thread Patch in this message | | | From | Nigel Cunningham <> | Subject | [Suspend2][ 04/11] [Suspend2] Find a suspend2 module given its name | Date | Tue, 27 Jun 2006 02:53:15 +1000 |
| |
Given the name of a Suspend2 module, return a pointer to it's struct suspend_module_ops.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
kernel/power/modules.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/kernel/power/modules.c b/kernel/power/modules.c index ff9b9d7..c18b5fb 100644 --- a/kernel/power/modules.c +++ b/kernel/power/modules.c @@ -71,3 +71,22 @@ unsigned long suspend_memory_for_modules return ((bytes + PAGE_SIZE - 1) >> PAGE_SHIFT); } +/* suspend_find_module_given_name + * Functionality : Return a module (if found), given a pointer + * to its name + */ + +struct suspend_module_ops *suspend_find_module_given_name(char *name) +{ + struct suspend_module_ops *this_module, *found_module = NULL; + + list_for_each_entry(this_module, &suspend_modules, module_list) { + if (!strcmp(name, this_module->name)) { + found_module = this_module; + break; + } + } + + return found_module; +} + -- 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/
| |