mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: [PATCH 1/7] macb: call macb_init at probe explecitly
Date: Fri,  8 Feb 2013 10:18:44 +0100	[thread overview]
Message-ID: <1360315130-23872-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20130208090739.GP19322@game.jcrosoft.org>

as eth_device init is planning for remove and we need the init before register
the mdio bus

Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/net/macb.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 2eba2a5..3aec0c4 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -241,9 +241,8 @@ static int macb_open(struct eth_device *edev)
 			       macb->interface);
 }
 
-static int macb_init(struct eth_device *edev)
+static void macb_init(struct macb_device *macb)
 {
-	struct macb_device *macb = edev->priv;
 	unsigned long paddr, val = 0;
 	int i;
 
@@ -284,8 +283,6 @@ static int macb_init(struct eth_device *edev)
 
 	/* Enable TX and RX */
 	macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE));
-
-	return 0;
 }
 
 static void macb_halt(struct eth_device *edev)
@@ -423,7 +420,6 @@ static int macb_probe(struct device_d *dev)
 
 	macb->dev = dev;
 
-	edev->init = macb_init;
 	edev->open = macb_open;
 	edev->send = macb_send;
 	edev->recv = macb_recv;
@@ -474,6 +470,8 @@ static int macb_probe(struct device_d *dev)
 
 	macb_writel(macb, NCFGR, ncfgr);
 
+	macb_init(macb);
+
 	mdiobus_register(&macb->miibus);
 	eth_register(edev);
 
-- 
1.7.10.4


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

  reply	other threads:[~2013-02-08  9:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08  9:07 [For master PATCH 0/7] macb: more fixes + gem (gigabit support) Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-02-08  9:18   ` [PATCH 2/7] macb: sync remaining define with linux Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 3/7] macb: use the macro as in linux for tx/rx buffer ring size Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 4/7] macb: enable Tramsmit and Receive at open Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 5/7] macb: reset the IP at init Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 6/7] macb: fix tx ring size Jean-Christophe PLAGNIOL-VILLARD
2013-02-08 12:20     ` Alexander Aring
2013-02-08 13:36       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-11 16:33     ` Sascha Hauer
2013-02-11 16:52       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 7/7] macb: add cadence Gigabit GEM support Jean-Christophe PLAGNIOL-VILLARD
2013-02-08 10:24 ` [For master PATCH 0/7] macb: more fixes + gem (gigabit support) Nicolas Ferre
2013-02-11  8:35 ` Sascha Hauer
2013-02-11 16:57 ` [PATCH 6/7 v2] macb: fix tx ring size Jean-Christophe PLAGNIOL-VILLARD
2013-02-11 16:57   ` [PATCH 7/7 v2] macb: add cadence Gigabit GEM support Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360315130-23872-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox