From 5ce7c218a7bd34672bd19359dcbeed51cc237474 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Fri, 1 Jul 2016 17:57:31 +0200
Subject: [PATCH 25/27] DP: add dp_get_module_data()
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit 35fa5a83ce8badf6bc868937047f44c3f32b7c28)
---
src/providers/data_provider/dp.h | 2 ++
src/providers/data_provider/dp_targets.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/src/providers/data_provider/dp.h b/src/providers/data_provider/dp.h
index 8cdbd7768a0b3f7f234b6bce6abab02419b3b9d1..5b36baf3489be4cce463dfb42c65a0b7f7ece9ef 100644
--- a/src/providers/data_provider/dp.h
+++ b/src/providers/data_provider/dp.h
@@ -118,6 +118,8 @@ bool _dp_target_enabled(struct data_provider *provider,
struct dp_module *dp_target_module(struct data_provider *provider,
enum dp_targets target);
+void *dp_get_module_data(struct dp_module *dp_module);
+
void _dp_set_method(struct dp_method *methods,
enum dp_methods method,
dp_req_send_fn send_fn,
diff --git a/src/providers/data_provider/dp_targets.c b/src/providers/data_provider/dp_targets.c
index e19cf93a3693dede98567d2105021488380b5408..87ecfe55daa805eec0265795ef76751a1568c474 100644
--- a/src/providers/data_provider/dp_targets.c
+++ b/src/providers/data_provider/dp_targets.c
@@ -88,6 +88,11 @@ struct dp_module *dp_target_module(struct data_provider *provider,
return provider->targets[target]->module;
}
+void *dp_get_module_data(struct dp_module *dp_module)
+{
+ return dp_module == NULL ? NULL : dp_module->module_data;
+}
+
const char *dp_target_to_string(enum dp_targets target)
{
switch (target) {
--
2.4.11