X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fnet%2Ftlan.c;h=0166407d7061b417f9d4276dfea49b15043ee39a;hb=62783679540fbdfd74e10fbe9478d978141ba45f;hp=c99ce74a7aff7251c3821314fab0e43be38ffd2f;hpb=2843483d2eb02ad104edbe8b2429fb6a39d25063;p=linux-2.6-omap-h63xx.git diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index c99ce74a7af..0166407d706 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c @@ -465,7 +465,7 @@ static struct pci_driver tlan_driver = { static int __init tlan_probe(void) { - static int pad_allocated; + int rc = -ENODEV; printk(KERN_INFO "%s", tlan_banner); @@ -473,17 +473,22 @@ static int __init tlan_probe(void) if (TLanPadBuffer == NULL) { printk(KERN_ERR "TLAN: Could not allocate memory for pad buffer.\n"); - return -ENOMEM; + rc = -ENOMEM; + goto err_out; } memset(TLanPadBuffer, 0, TLAN_MIN_FRAME_SIZE); - pad_allocated = 1; TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n"); /* Use new style PCI probing. Now the kernel will do most of this for us */ - pci_register_driver(&tlan_driver); + rc = pci_register_driver(&tlan_driver); + + if (rc != 0) { + printk(KERN_ERR "TLAN: Could not register pci driver.\n"); + goto err_out_pci_free; + } TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n"); TLan_EisaProbe(); @@ -493,11 +498,17 @@ static int __init tlan_probe(void) tlan_have_pci, tlan_have_eisa); if (TLanDevicesInstalled == 0) { - pci_unregister_driver(&tlan_driver); - pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, TLanPadBufferDMA); - return -ENODEV; + rc = -ENODEV; + goto err_out_pci_unreg; } return 0; + +err_out_pci_unreg: + pci_unregister_driver(&tlan_driver); +err_out_pci_free: + pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, TLanPadBufferDMA); +err_out: + return rc; } @@ -1389,7 +1400,7 @@ static void TLan_SetMulticastList( struct net_device *dev ) * **************************************************************/ -u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int ) { /* printk( "TLAN: Invalid interrupt on %s.\n", dev->name ); */ return 0; @@ -1421,7 +1432,7 @@ u32 TLan_HandleInvalid( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int ) { TLanPrivateInfo *priv = netdev_priv(dev); int eoc = 0; @@ -1507,7 +1518,7 @@ u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int ) { TLan_ReadAndClearStats( dev, TLAN_RECORD ); @@ -1543,7 +1554,7 @@ u32 TLan_HandleStatOverflow( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int ) { TLanPrivateInfo *priv = netdev_priv(dev); u32 ack = 0; @@ -1678,7 +1689,7 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleDummy( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleDummy( struct net_device *dev, u16 host_int ) { printk( "TLAN: Test interrupt on %s.\n", dev->name ); return 1; @@ -1708,7 +1719,7 @@ u32 TLan_HandleDummy( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int ) { TLanPrivateInfo *priv = netdev_priv(dev); TLanList *head_list; @@ -1756,7 +1767,7 @@ u32 TLan_HandleTxEOC( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) { TLanPrivateInfo *priv = netdev_priv(dev); u32 ack; @@ -1831,7 +1842,7 @@ u32 TLan_HandleStatusCheck( struct net_device *dev, u16 host_int ) * **************************************************************/ -u32 TLan_HandleRxEOC( struct net_device *dev, u16 host_int ) +static u32 TLan_HandleRxEOC( struct net_device *dev, u16 host_int ) { TLanPrivateInfo *priv = netdev_priv(dev); dma_addr_t head_list_phys; @@ -1891,7 +1902,7 @@ u32 TLan_HandleRxEOC( struct net_device *dev, u16 host_int ) * **************************************************************/ -void TLan_Timer( unsigned long data ) +static void TLan_Timer( unsigned long data ) { struct net_device *dev = (struct net_device *) data; TLanPrivateInfo *priv = netdev_priv(dev); @@ -1972,7 +1983,7 @@ void TLan_Timer( unsigned long data ) * **************************************************************/ -void TLan_ResetLists( struct net_device *dev ) +static void TLan_ResetLists( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); int i; @@ -2032,7 +2043,7 @@ void TLan_ResetLists( struct net_device *dev ) } /* TLan_ResetLists */ -void TLan_FreeLists( struct net_device *dev ) +static void TLan_FreeLists( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); int i; @@ -2081,7 +2092,7 @@ void TLan_FreeLists( struct net_device *dev ) * **************************************************************/ -void TLan_PrintDio( u16 io_base ) +static void TLan_PrintDio( u16 io_base ) { u32 data0, data1; int i; @@ -2116,7 +2127,7 @@ void TLan_PrintDio( u16 io_base ) * **************************************************************/ -void TLan_PrintList( TLanList *list, char *type, int num) +static void TLan_PrintList( TLanList *list, char *type, int num) { int i; @@ -2152,7 +2163,7 @@ void TLan_PrintList( TLanList *list, char *type, int num) * **************************************************************/ -void TLan_ReadAndClearStats( struct net_device *dev, int record ) +static void TLan_ReadAndClearStats( struct net_device *dev, int record ) { TLanPrivateInfo *priv = netdev_priv(dev); u32 tx_good, tx_under; @@ -2227,7 +2238,7 @@ void TLan_ReadAndClearStats( struct net_device *dev, int record ) * **************************************************************/ -void +static void TLan_ResetAdapter( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); @@ -2313,7 +2324,7 @@ TLan_ResetAdapter( struct net_device *dev ) -void +static void TLan_FinishReset( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); @@ -2437,7 +2448,7 @@ TLan_FinishReset( struct net_device *dev ) * **************************************************************/ -void TLan_SetMac( struct net_device *dev, int areg, char *mac ) +static void TLan_SetMac( struct net_device *dev, int areg, char *mac ) { int i; @@ -2479,7 +2490,7 @@ void TLan_SetMac( struct net_device *dev, int areg, char *mac ) * ********************************************************************/ -void TLan_PhyPrint( struct net_device *dev ) +static void TLan_PhyPrint( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 i, data0, data1, data2, data3, phy; @@ -2528,7 +2539,7 @@ void TLan_PhyPrint( struct net_device *dev ) * ********************************************************************/ -void TLan_PhyDetect( struct net_device *dev ) +static void TLan_PhyDetect( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 control; @@ -2575,7 +2586,7 @@ void TLan_PhyDetect( struct net_device *dev ) -void TLan_PhyPowerDown( struct net_device *dev ) +static void TLan_PhyPowerDown( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 value; @@ -2600,7 +2611,7 @@ void TLan_PhyPowerDown( struct net_device *dev ) -void TLan_PhyPowerUp( struct net_device *dev ) +static void TLan_PhyPowerUp( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 value; @@ -2621,7 +2632,7 @@ void TLan_PhyPowerUp( struct net_device *dev ) -void TLan_PhyReset( struct net_device *dev ) +static void TLan_PhyReset( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 phy; @@ -2649,7 +2660,7 @@ void TLan_PhyReset( struct net_device *dev ) -void TLan_PhyStartLink( struct net_device *dev ) +static void TLan_PhyStartLink( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 ability; @@ -2736,7 +2747,7 @@ void TLan_PhyStartLink( struct net_device *dev ) -void TLan_PhyFinishAutoNeg( struct net_device *dev ) +static void TLan_PhyFinishAutoNeg( struct net_device *dev ) { TLanPrivateInfo *priv = netdev_priv(dev); u16 an_adv; @@ -2892,7 +2903,7 @@ void TLan_PhyMonitor( struct net_device *dev ) * **************************************************************/ -int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val ) +static int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val ) { u8 nack; u16 sio, tmp; @@ -2982,7 +2993,7 @@ int TLan_MiiReadReg( struct net_device *dev, u16 phy, u16 reg, u16 *val ) * **************************************************************/ -void TLan_MiiSendData( u16 base_port, u32 data, unsigned num_bits ) +static void TLan_MiiSendData( u16 base_port, u32 data, unsigned num_bits ) { u16 sio; u32 i; @@ -3024,7 +3035,7 @@ void TLan_MiiSendData( u16 base_port, u32 data, unsigned num_bits ) * **************************************************************/ -void TLan_MiiSync( u16 base_port ) +static void TLan_MiiSync( u16 base_port ) { int i; u16 sio; @@ -3063,7 +3074,7 @@ void TLan_MiiSync( u16 base_port ) * **************************************************************/ -void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val ) +static void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val ) { u16 sio; int minten; @@ -3133,7 +3144,7 @@ void TLan_MiiWriteReg( struct net_device *dev, u16 phy, u16 reg, u16 val ) * **************************************************************/ -void TLan_EeSendStart( u16 io_base ) +static void TLan_EeSendStart( u16 io_base ) { u16 sio; @@ -3173,7 +3184,7 @@ void TLan_EeSendStart( u16 io_base ) * **************************************************************/ -int TLan_EeSendByte( u16 io_base, u8 data, int stop ) +static int TLan_EeSendByte( u16 io_base, u8 data, int stop ) { int err; u8 place; @@ -3234,7 +3245,7 @@ int TLan_EeSendByte( u16 io_base, u8 data, int stop ) * **************************************************************/ -void TLan_EeReceiveByte( u16 io_base, u8 *data, int stop ) +static void TLan_EeReceiveByte( u16 io_base, u8 *data, int stop ) { u8 place; u16 sio; @@ -3292,7 +3303,7 @@ void TLan_EeReceiveByte( u16 io_base, u8 *data, int stop ) * **************************************************************/ -int TLan_EeReadByte( struct net_device *dev, u8 ee_addr, u8 *data ) +static int TLan_EeReadByte( struct net_device *dev, u8 ee_addr, u8 *data ) { int err; TLanPrivateInfo *priv = netdev_priv(dev);