From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: Ben Dooks <ben@fluff.org>, Daniel Mack <daniel@caiaq.de>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 4/9] ax88796: remove first_init parameter from ax_init_dev()
Date: Mon, 21 Feb 2011 14:03:15 +0100 [thread overview]
Message-ID: <1298293400-21570-5-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1298293400-21570-1-git-send-email-mkl@pengutronix.de>
ax_init_dev() is always called with first_init=1.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/ax88796.c | 44 +++++++++++++++++++-------------------------
1 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 885f04e..eac5b10 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -675,7 +675,7 @@ static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local)
* the device is ready to be used by lib8390.c and registerd with
* the network layer.
*/
-static int ax_init_dev(struct net_device *dev, int first_init)
+static int ax_init_dev(struct net_device *dev)
{
struct ei_device *ei_local = netdev_priv(dev);
struct ax_device *ax = to_ax_dev(dev);
@@ -695,7 +695,7 @@ static int ax_init_dev(struct net_device *dev, int first_init)
/* read the mac from the card prom if we need it */
- if (first_init && ax->plat->flags & AXFLG_HAS_EEPROM) {
+ if (ax->plat->flags & AXFLG_HAS_EEPROM) {
unsigned char SA_prom[32];
for (i = 0; i < sizeof(SA_prom); i += 2) {
@@ -711,7 +711,7 @@ static int ax_init_dev(struct net_device *dev, int first_init)
}
#ifdef CONFIG_AX88796_93CX6
- if (first_init && ax->plat->flags & AXFLG_HAS_93CX6) {
+ if (ax->plat->flags & AXFLG_HAS_93CX6) {
unsigned char mac_addr[6];
struct eeprom_93cx6 eeprom;
@@ -737,25 +737,20 @@ static int ax_init_dev(struct net_device *dev, int first_init)
stop_page = NE1SM_STOP_PG;
}
- /*
- * load the mac-address from the device if this is the first
- * time we've initialised
- */
- if (first_init) {
- if (ax->plat->flags & AXFLG_MAC_FROMDEV) {
- ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP,
- ei_local->mem + E8390_CMD); /* 0x61 */
- for (i = 0; i < ETHER_ADDR_LEN; i++)
- dev->dev_addr[i] =
- ei_inb(ioaddr + EN1_PHYS_SHIFT(i));
- }
-
- if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) &&
- ax->plat->mac_addr)
- memcpy(dev->dev_addr, ax->plat->mac_addr,
- ETHER_ADDR_LEN);
+ /* load the mac-address from the device */
+ if (ax->plat->flags & AXFLG_MAC_FROMDEV) {
+ ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP,
+ ei_local->mem + E8390_CMD); /* 0x61 */
+ for (i = 0; i < ETHER_ADDR_LEN; i++)
+ dev->dev_addr[i] =
+ ei_inb(ioaddr + EN1_PHYS_SHIFT(i));
}
+ if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) &&
+ ax->plat->mac_addr)
+ memcpy(dev->dev_addr, ax->plat->mac_addr,
+ ETHER_ADDR_LEN);
+
ax_reset_8390(dev);
ei_local->name = "AX88796";
@@ -790,10 +785,9 @@ static int ax_init_dev(struct net_device *dev, int first_init)
ax_NS8390_init(dev, 0);
- if (first_init)
- dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %pM\n",
- ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr,
- dev->dev_addr);
+ dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %pM\n",
+ ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr,
+ dev->dev_addr);
ret = register_netdev(dev);
if (ret)
@@ -949,7 +943,7 @@ static int ax_probe(struct platform_device *pdev)
/* got resources, now initialise and register device */
- ret = ax_init_dev(dev, 1);
+ ret = ax_init_dev(dev);
if (!ret)
return 0;
--
1.7.2.3
next prev parent reply other threads:[~2011-02-21 13:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 13:03 [PATCH 0/9] ax88796: cleanups and convert to phylib and mdio_bitbang Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 1/9] ax88796: fix codingstyle and checkpatch warnings Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 2/9] ax88796: don't use magic ei_status to acces private data Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 3/9] ax88796: remove memset of " Marc Kleine-Budde
2011-02-21 13:03 ` Marc Kleine-Budde [this message]
2011-02-21 13:03 ` [PATCH 5/9] ax88796: use netdev_<LEVEL> instead of dev_<LEVEL> and pr_<LEVEL> Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 6/9] ax88796: remove platform_device member from struct ax_device Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 7/9] ax88796: make pointer to platform data const Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 8/9] ax88796: clean up probe and remove function Marc Kleine-Budde
2011-02-21 13:03 ` [PATCH 9/9] ax88796: use generic mdio_bitbang driver Marc Kleine-Budde
2011-02-22 19:18 ` [PATCH 0/9] ax88796: cleanups and convert to phylib and mdio_bitbang David Miller
2011-02-22 20:19 ` [PATCH] ax88796: depend on HAS_IOMEM not on individual ARCHs Marc Kleine-Budde
2011-02-22 20:37 ` David Miller
2011-02-22 21:42 ` Marc Kleine-Budde
2011-02-22 22:01 ` David Miller
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=1298293400-21570-5-git-send-email-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=ben@fluff.org \
--cc=daniel@caiaq.de \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).