mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Cc: wsa@pengutronix.de
Subject: [PATCH 1/2] net eth: make edev->init optional
Date: Tue, 30 Oct 2012 17:30:05 +0100	[thread overview]
Message-ID: <1351614606-16461-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1351614606-16461-1-git-send-email-s.hauer@pengutronix.de>

edev->init is called at eth_register time unconditionally and is supposed
to initialize the ethernet hardware. Since it's called unconditionally
this could be done by the driver without having an additional hook.
Some drivers need their initialization done earlier since they also register
a mdiobus which does hardware accesses on registration time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 net/eth.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/eth.c b/net/eth.c
index f3d7bfe..2cfdb96 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -269,7 +269,8 @@ int eth_register(struct eth_device *edev)
 	dev_add_param(dev, "netmask", eth_set_ipaddr, NULL, 0);
 	dev_add_param(dev, "serverip", eth_set_ipaddr, NULL, 0);
 
-	edev->init(edev);
+	if (edev->init)
+		edev->init(edev);
 
 	list_add_tail(&edev->list, &netdev_list);
 
-- 
1.7.10.4


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

  reply	other threads:[~2012-10-30 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 16:30 [PATCH] i.MX fec fixes Sascha Hauer
2012-10-30 16:30 ` Sascha Hauer [this message]
2012-10-30 16:30 ` [PATCH 2/2] net fec: call fec_init at probe time Sascha Hauer
2012-10-31  8:25   ` Wolfram Sang
2012-10-31 20:52     ` Sascha Hauer

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=1351614606-16461-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=wsa@pengutronix.de \
    /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