[PATCH 01/21] param: Add dev member to struct param_d

Sascha Hauer s.hauer at pengutronix.de
Sun Apr 7 10:00:35 EDT 2013


This will make it unnecessary to pass the dev pointer around later.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/param.h | 1 +
 lib/parameter.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/include/param.h b/include/param.h
index 3a585cd..2a1b4fa 100644
--- a/include/param.h
+++ b/include/param.h
@@ -15,6 +15,7 @@ struct param_d {
 	unsigned int flags;
 	char *name;
 	char *value;
+	struct device_d *dev;
 	struct list_head list;
 };
 
diff --git a/lib/parameter.c b/lib/parameter.c
index c00b824..94da79c 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -159,6 +159,7 @@ static struct param_d *__dev_add_param(struct device_d *dev, const char *name,
 
 	param->name = strdup(name);
 	param->flags = flags;
+	param->dev = dev;
 	list_add_tail(&param->list, &dev->parameters);
 
 	return param;
-- 
1.8.2.rc2




More information about the barebox mailing list