From: Nigel Cunningham <nigel@suspend2.net>
To: linux-kernel@vger.kernel.org
Subject: [Suspend2][ 04/11] [Suspend2] Find a suspend2 module given its name
Date: Tue, 27 Jun 2006 02:53:15 +1000 [thread overview]
Message-ID: <20060626165314.10957.4181.stgit@nigel.suspend2.net> (raw)
In-Reply-To: <20060626165301.10957.62592.stgit@nigel.suspend2.net>
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
next prev parent reply other threads:[~2006-06-26 17:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 16:53 [Suspend2][ 00/11 Module support Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 01/11] [Suspend2] Modules.c header Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 02/11] [Suspend2] Get header storage needed for module data Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 03/11] [Suspend2] Get memory needed for Suspend2 modules Nigel Cunningham
2006-06-26 16:53 ` Nigel Cunningham [this message]
2006-06-26 16:53 ` [Suspend2][ 05/11] [Suspend2] Get debugging info from modules Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 06/11] [Suspend2] Register and unregister suspend2 modules Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 07/11] [Suspend2] Move a suspend2 module to the tail of its list Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 08/11] [Suspend2] Initialise and cleanup routines for suspend2 modules Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 09/11] [Suspend2] Get next suspend2 module in the pipeline Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 10/11] [Suspend2] Get and put references to Suspend2 modules Nigel Cunningham
2006-06-26 16:53 ` [Suspend2][ 11/11] [Suspend2] Header file for " Nigel Cunningham
2006-06-26 21:15 ` [Suspend2][ 00/11 Module support Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060626165314.10957.4181.stgit@nigel.suspend2.net \
--to=nigel@suspend2.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®