lkml.org 
[lkml]   [2006]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 08/10] [Suspend2] Find a module given its name
    Date

    Given the name of a module, return a pointer to it, or NULL if not found.
    This is used when reloading the configuration data at resume time.

    Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

    kernel/power/modules.c | 20 ++++++++++++++++++++
    1 files changed, 20 insertions(+), 0 deletions(-)

    diff --git a/kernel/power/modules.c b/kernel/power/modules.c
    index 7d56ce0..63f9dbb 100644
    --- a/kernel/power/modules.c
    +++ b/kernel/power/modules.c
    @@ -37,6 +37,26 @@ unsigned long header_storage_for_modules

    return bytes;
    }
    +
    +/* find_module_given_name
    + * Functionality : Return a module (if found), given a pointer
    + * to its name
    + */
    +
    +struct suspend_module_ops *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;
    +}
    +
    * suspend_register_module
    *
    * Register a 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/

    \
     
     \ /
      Last update: 2006-02-01 12:46    [W:0.021 / U:59.760 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site