[PATCH 07/10] net: use dev_add_param_string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



dev_add_param_string allows to pass a priv * so that the device_d *
argument is not needed and can be removed later.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 net/net.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/net.c b/net/net.c
index 3c0e715601..19b081f6cf 100644
--- a/net/net.c
+++ b/net/net.c
@@ -573,6 +573,9 @@ static struct device_d net_device = {
 	.id = DEVICE_ID_SINGLE,
 };
 
+static char *net_nameserver;
+static char *net_domainname;
+
 static int net_init(void)
 {
 	int i;
@@ -581,8 +584,12 @@ static int net_init(void)
 		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);
+	net_nameserver = xstrdup("");
+	dev_add_param_string(&net_device, "nameserver", NULL, NULL,
+			     &net_nameserver, NULL);
+	net_domainname = xstrdup("");
+	dev_add_param_string(&net_device, "domainname", NULL, NULL,
+			     &net_domainname, NULL);
 
 	return 0;
 }
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux