[PATCH 3/5] net: switch to global device

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Sep 24 11:40:26 EDT 2012


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 net/net.c |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/net.c b/net/net.c
index 3ac098f..6455b18 100644
--- a/net/net.c
+++ b/net/net.c
@@ -35,6 +35,7 @@
 #include <init.h>
 #include <linux/ctype.h>
 #include <linux/err.h>
+#include <globalvar.h>
 
 static IPaddr_t	net_netmask;		/* Our subnet mask (0=unknown)	*/
 static IPaddr_t	net_gateway;		/* Our gateways IP address	*/
@@ -664,21 +665,19 @@ out:
 	return ret;
 }
 
-static struct device_d net_device = {
-	.name = "net",
-	.id = DEVICE_ID_SINGLE,
-};
-
 static int net_init(void)
 {
+	struct device_d *dev;
 	int i;
 
 	for (i = 0; i < PKTBUFSRX; i++)
 		NetRxPackets[i] = net_alloc_packet();
 
-	register_device(&net_device);
-	dev_add_param(&net_device, "nameserver", NULL, NULL, 0);
-	dev_add_param(&net_device, "domainname", NULL, NULL, 0);
+	dev = global_add_device("net");
+	if (dev) {
+		global_add_simple(dev, "nameserver");
+		global_add_simple(dev, "domainname");
+	}
 
 	return 0;
 }
-- 
1.7.10.4




More information about the barebox mailing list