[Suspend2][ 09/11] [Suspend2] Get next suspend2 module in the pipeline.

From: Nigel Cunningham
Date: Mon Jun 26 2006 - 12:53:36 EST


Suspend2 modules are strung together in a pipeline. This function enables
one module in the pipeline to find out what the next module is, so that it
can pass its output to that module when writing, and request data from it
when reading.

Signed-off-by: Nigel Cunningham <nigel@xxxxxxxxxxxx>

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 cd171a8..d7c2076 100644
--- a/kernel/power/modules.c
+++ b/kernel/power/modules.c
@@ -268,6 +268,26 @@ void suspend_cleanup_modules(int finishi
}
}

+/*
+ * suspend_get_next_filter
+ *
+ * Get the next filter in the pipeline.
+ */
+struct suspend_module_ops *suspend_get_next_filter(struct suspend_module_ops *filter_sought)
+{
+ struct suspend_module_ops *last_filter = NULL, *this_filter = NULL;
+
+ list_for_each_entry(this_filter, &suspend_filters, type_list) {
+ if (this_filter->disabled)
+ continue;
+ if ((last_filter == filter_sought) || (!filter_sought))
+ return this_filter;
+ last_filter = this_filter;
+ }
+
+ return suspend_active_writer;
+}
+
return len;
}


--
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/