diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2011-02-19 17:07:09 -0500 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2011-02-21 07:13:41 -0500 |
commit | 1cbece33ff657cfc9782963d502f3c3be07c0317 (patch) | |
tree | 2c73b59a369111f14495b1461c4ee868322c4404 /drivers/net/ax88796.c | |
parent | 2f9709dbdf2777c88b7f1f9a8283119f17f7373e (diff) |
ax88796: remove first_init parameter from ax_init_dev()
ax_init_dev() is always called with first_init=1.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/ax88796.c')
-rw-r--r-- | 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 885f04ec1518..eac5b101beb7 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) | |||
675 | * the device is ready to be used by lib8390.c and registerd with | 675 | * the device is ready to be used by lib8390.c and registerd with |
676 | * the network layer. | 676 | * the network layer. |
677 | */ | 677 | */ |
678 | static int ax_init_dev(struct net_device *dev, int first_init) | 678 | static int ax_init_dev(struct net_device *dev) |
679 | { | 679 | { |
680 | struct ei_device *ei_local = netdev_priv(dev); | 680 | struct ei_device *ei_local = netdev_priv(dev); |
681 | struct ax_device *ax = to_ax_dev(dev); | 681 | struct ax_device *ax = to_ax_dev(dev); |
@@ -695,7 +695,7 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
695 | 695 | ||
696 | /* read the mac from the card prom if we need it */ | 696 | /* read the mac from the card prom if we need it */ |
697 | 697 | ||
698 | if (first_init && ax->plat->flags & AXFLG_HAS_EEPROM) { | 698 | if (ax->plat->flags & AXFLG_HAS_EEPROM) { |
699 | unsigned char SA_prom[32]; | 699 | unsigned char SA_prom[32]; |
700 | 700 | ||
701 | for (i = 0; i < sizeof(SA_prom); i += 2) { | 701 | 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) | |||
711 | } | 711 | } |
712 | 712 | ||
713 | #ifdef CONFIG_AX88796_93CX6 | 713 | #ifdef CONFIG_AX88796_93CX6 |
714 | if (first_init && ax->plat->flags & AXFLG_HAS_93CX6) { | 714 | if (ax->plat->flags & AXFLG_HAS_93CX6) { |
715 | unsigned char mac_addr[6]; | 715 | unsigned char mac_addr[6]; |
716 | struct eeprom_93cx6 eeprom; | 716 | struct eeprom_93cx6 eeprom; |
717 | 717 | ||
@@ -737,25 +737,20 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
737 | stop_page = NE1SM_STOP_PG; | 737 | stop_page = NE1SM_STOP_PG; |
738 | } | 738 | } |
739 | 739 | ||
740 | /* | 740 | /* load the mac-address from the device */ |
741 | * load the mac-address from the device if this is the first | 741 | if (ax->plat->flags & AXFLG_MAC_FROMDEV) { |
742 | * time we've initialised | 742 | ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP, |
743 | */ | 743 | ei_local->mem + E8390_CMD); /* 0x61 */ |
744 | if (first_init) { | 744 | for (i = 0; i < ETHER_ADDR_LEN; i++) |
745 | if (ax->plat->flags & AXFLG_MAC_FROMDEV) { | 745 | dev->dev_addr[i] = |
746 | ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP, | 746 | ei_inb(ioaddr + EN1_PHYS_SHIFT(i)); |
747 | ei_local->mem + E8390_CMD); /* 0x61 */ | ||
748 | for (i = 0; i < ETHER_ADDR_LEN; i++) | ||
749 | dev->dev_addr[i] = | ||
750 | ei_inb(ioaddr + EN1_PHYS_SHIFT(i)); | ||
751 | } | ||
752 | |||
753 | if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) && | ||
754 | ax->plat->mac_addr) | ||
755 | memcpy(dev->dev_addr, ax->plat->mac_addr, | ||
756 | ETHER_ADDR_LEN); | ||
757 | } | 747 | } |
758 | 748 | ||
749 | if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) && | ||
750 | ax->plat->mac_addr) | ||
751 | memcpy(dev->dev_addr, ax->plat->mac_addr, | ||
752 | ETHER_ADDR_LEN); | ||
753 | |||
759 | ax_reset_8390(dev); | 754 | ax_reset_8390(dev); |
760 | 755 | ||
761 | ei_local->name = "AX88796"; | 756 | ei_local->name = "AX88796"; |
@@ -790,10 +785,9 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
790 | 785 | ||
791 | ax_NS8390_init(dev, 0); | 786 | ax_NS8390_init(dev, 0); |
792 | 787 | ||
793 | if (first_init) | 788 | dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %pM\n", |
794 | dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %pM\n", | 789 | ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr, |
795 | ei_local->word16 ? 16 : 8, dev->irq, dev->base_addr, | 790 | dev->dev_addr); |
796 | dev->dev_addr); | ||
797 | 791 | ||
798 | ret = register_netdev(dev); | 792 | ret = register_netdev(dev); |
799 | if (ret) | 793 | if (ret) |
@@ -949,7 +943,7 @@ static int ax_probe(struct platform_device *pdev) | |||
949 | 943 | ||
950 | /* got resources, now initialise and register device */ | 944 | /* got resources, now initialise and register device */ |
951 | 945 | ||
952 | ret = ax_init_dev(dev, 1); | 946 | ret = ax_init_dev(dev); |
953 | if (!ret) | 947 | if (!ret) |
954 | return 0; | 948 | return 0; |
955 | 949 | ||