fbdev: section cleanup in w100fb
[safe/jmp/linux-2.6] / drivers / net / arcnet / com20020.c
index 8b51313..c9e4594 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/ioport.h>
-#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/netdevice.h>
@@ -89,7 +88,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum,
 int com20020_check(struct net_device *dev)
 {
        int ioaddr = dev->base_addr, status;
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
 
        ARCRESET0;
        mdelay(RESETtime);
@@ -149,6 +148,14 @@ int com20020_check(struct net_device *dev)
        return 0;
 }
 
+const struct net_device_ops com20020_netdev_ops = {
+       .ndo_open       = arcnet_open,
+       .ndo_stop       = arcnet_close,
+       .ndo_start_xmit = arcnet_send_packet,
+       .ndo_tx_timeout = arcnet_timeout,
+       .ndo_set_multicast_list = com20020_set_mc_list,
+};
+
 /* Set up the struct net_device associated with this card.  Called after
  * probing succeeds.
  */
@@ -159,7 +166,7 @@ int com20020_found(struct net_device *dev, int shared)
 
        /* Initialize the rest of the device structure. */
 
-       lp = dev->priv;
+       lp = netdev_priv(dev);
 
        lp->hw.owner = THIS_MODULE;
        lp->hw.command = com20020_command;
@@ -170,8 +177,6 @@ int com20020_found(struct net_device *dev, int shared)
        lp->hw.copy_from_card = com20020_copy_from_card;
        lp->hw.close = com20020_close;
 
-       dev->set_multicast_list = com20020_set_mc_list;
-
        if (!dev->dev_addr[0])
                dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN*8);   /* FIXME: do this some other way! */
 
@@ -194,7 +199,7 @@ int com20020_found(struct net_device *dev, int shared)
        outb(dev->dev_addr[0], _XREG);
 
        /* reserve the irq */
-       if (request_irq(dev->irq, &arcnet_interrupt, shared,
+       if (request_irq(dev->irq, arcnet_interrupt, shared,
                        "arcnet (COM20020)", dev)) {
                BUGMSG(D_NORMAL, "Can't get IRQ %d!\n", dev->irq);
                return -ENODEV;
@@ -233,20 +238,20 @@ int com20020_found(struct net_device *dev, int shared)
  */
 static int com20020_reset(struct net_device *dev, int really_reset)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        u_int ioaddr = dev->base_addr;
        u_char inbyte;
 
        BUGMSG(D_DEBUG, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n",
-               __FILE__,__LINE__,__FUNCTION__,dev,lp,dev->name);
+               __FILE__,__LINE__,__func__,dev,lp,dev->name);
        BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n",
               dev->name, ASTATUS());
 
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
        lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2);
        /* power-up defaults */
        SETCONF;
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
 
        if (really_reset) {
                /* reset the card */
@@ -254,22 +259,22 @@ static int com20020_reset(struct net_device *dev, int really_reset)
                mdelay(RESETtime * 2);  /* COM20020 seems to be slower sometimes */
        }
        /* clear flags & end reset */
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
        ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
 
        /* verify that the ARCnet signature byte is present */
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
 
        com20020_copy_from_card(dev, 0, 0, &inbyte, 1);
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
        if (inbyte != TESTvalue) {
-               BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+               BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
                BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n");
                return 1;
        }
        /* enable extended (512-byte) packets */
        ACOMMAND(CONFIGcmd | EXTconf);
-       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__FUNCTION__);
+       BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__);
 
        /* done!  return success. */
        return 0;
@@ -300,7 +305,7 @@ static int com20020_status(struct net_device *dev)
 
 static void com20020_close(struct net_device *dev)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
 
        /* disable transmitter */
@@ -317,7 +322,7 @@ static void com20020_close(struct net_device *dev)
  */
 static void com20020_set_mc_list(struct net_device *dev)
 {
-       struct arcnet_local *lp = dev->priv;
+       struct arcnet_local *lp = netdev_priv(dev);
        int ioaddr = dev->base_addr;
 
        if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) {      /* Enable promiscuous mode */
@@ -342,6 +347,7 @@ static void com20020_set_mc_list(struct net_device *dev)
     defined(CONFIG_ARCNET_COM20020_CS_MODULE)
 EXPORT_SYMBOL(com20020_check);
 EXPORT_SYMBOL(com20020_found);
+EXPORT_SYMBOL(com20020_netdev_ops);
 #endif
 
 MODULE_LICENSE("GPL");