aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2009-02-04 19:42:12 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-04 19:42:35 -0500
commit1577ecef766650a57fceb171acee2b13cbfaf1d3 (patch)
treeb66df11d8815f95f815e65c3c3ffd32df81b8d43 /drivers/net/gianfar.c
parent9c46f6d42f1b5627c49a5906cb5b315ad8716ff0 (diff)
netdev: Merge UCC and gianfar MDIO bus drivers
The MDIO bus drivers for the UCC and gianfar ethernet controllers are essentially the same. There's no reason to duplicate that much code. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r--drivers/net/gianfar.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index eb8302c5ba8c..bd21b6d5f13c 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -93,7 +93,7 @@
93#include <linux/of.h> 93#include <linux/of.h>
94 94
95#include "gianfar.h" 95#include "gianfar.h"
96#include "gianfar_mii.h" 96#include "fsl_pq_mdio.h"
97 97
98#define TX_TIMEOUT (1*HZ) 98#define TX_TIMEOUT (1*HZ)
99#undef BRIEF_GFAR_ERRORS 99#undef BRIEF_GFAR_ERRORS
@@ -253,7 +253,7 @@ static int gfar_of_init(struct net_device *dev)
253 of_node_put(phy); 253 of_node_put(phy);
254 of_node_put(mdio); 254 of_node_put(mdio);
255 255
256 gfar_mdio_bus_name(bus_name, mdio); 256 fsl_pq_mdio_bus_name(bus_name, mdio);
257 snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x", 257 snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x",
258 bus_name, *id); 258 bus_name, *id);
259 } 259 }
@@ -420,7 +420,7 @@ static int gfar_probe(struct of_device *ofdev,
420 priv->hash_width = 8; 420 priv->hash_width = 8;
421 421
422 priv->hash_regs[0] = &priv->regs->gaddr0; 422 priv->hash_regs[0] = &priv->regs->gaddr0;
423 priv->hash_regs[1] = &priv->regs->gaddr1; 423 priv->hash_regs[1] = &priv->regs->gaddr1;
424 priv->hash_regs[2] = &priv->regs->gaddr2; 424 priv->hash_regs[2] = &priv->regs->gaddr2;
425 priv->hash_regs[3] = &priv->regs->gaddr3; 425 priv->hash_regs[3] = &priv->regs->gaddr3;
426 priv->hash_regs[4] = &priv->regs->gaddr4; 426 priv->hash_regs[4] = &priv->regs->gaddr4;
@@ -836,7 +836,7 @@ void stop_gfar(struct net_device *dev)
836 free_irq(priv->interruptTransmit, dev); 836 free_irq(priv->interruptTransmit, dev);
837 free_irq(priv->interruptReceive, dev); 837 free_irq(priv->interruptReceive, dev);
838 } else { 838 } else {
839 free_irq(priv->interruptTransmit, dev); 839 free_irq(priv->interruptTransmit, dev);
840 } 840 }
841 841
842 free_skb_resources(priv); 842 free_skb_resources(priv);
@@ -1829,6 +1829,8 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1829 skb_put(skb, pkt_len); 1829 skb_put(skb, pkt_len);
1830 dev->stats.rx_bytes += pkt_len; 1830 dev->stats.rx_bytes += pkt_len;
1831 1831
1832 if (in_irq() || irqs_disabled())
1833 printk("Interrupt problem!\n");
1832 gfar_process_frame(dev, skb, amount_pull); 1834 gfar_process_frame(dev, skb, amount_pull);
1833 1835
1834 } else { 1836 } else {
@@ -2302,23 +2304,12 @@ static struct of_platform_driver gfar_driver = {
2302 2304
2303static int __init gfar_init(void) 2305static int __init gfar_init(void)
2304{ 2306{
2305 int err = gfar_mdio_init(); 2307 return of_register_platform_driver(&gfar_driver);
2306
2307 if (err)
2308 return err;
2309
2310 err = of_register_platform_driver(&gfar_driver);
2311
2312 if (err)
2313 gfar_mdio_exit();
2314
2315 return err;
2316} 2308}
2317 2309
2318static void __exit gfar_exit(void) 2310static void __exit gfar_exit(void)
2319{ 2311{
2320 of_unregister_platform_driver(&gfar_driver); 2312 of_unregister_platform_driver(&gfar_driver);
2321 gfar_mdio_exit();
2322} 2313}
2323 2314
2324module_init(gfar_init); 2315module_init(gfar_init);