From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 8.mo1.mail-out.ovh.net ([178.33.110.239] helo=mo1.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UFq7Q-0008Fz-7Z for barebox@lists.infradead.org; Wed, 13 Mar 2013 18:09:41 +0000 Received: from mail645.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo1.mail-out.ovh.net (Postfix) with SMTP id 5B919FF9CF8 for ; Wed, 13 Mar 2013 19:26:23 +0100 (CET) From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 13 Mar 2013 19:05:19 +0100 Message-Id: <1363197922-19851-4-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1363197922-19851-1-git-send-email-plagnioj@jcrosoft.com> References: <20130313180100.GJ1568@game.jcrosoft.org> <1363197922-19851-1-git-send-email-plagnioj@jcrosoft.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 4/7] net: switch to global device To: barebox@lists.infradead.org Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- net/net.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/net/net.c b/net/net.c index 639bc2d..4888d60 100644 --- a/net/net.c +++ b/net/net.c @@ -35,6 +35,7 @@ #include #include #include +#include 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 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox