Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[pandora-kernel.git] / drivers / net / wan / farsync.c
index ad7719f..ebb9f24 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/if.h>
 #include <linux/hdlc.h>
 #include <asm/io.h>
@@ -885,20 +886,21 @@ fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
  *      Receive a frame through the DMA
  */
 static inline void
-fst_rx_dma(struct fst_card_info *card, unsigned char *skb,
-          unsigned char *mem, int len)
+fst_rx_dma(struct fst_card_info *card, dma_addr_t skb,
+          dma_addr_t mem, int len)
 {
        /*
         * This routine will setup the DMA and start it
         */
 
-       dbg(DBG_RX, "In fst_rx_dma %p %p %d\n", skb, mem, len);
+       dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n",
+           (unsigned long) skb, (unsigned long) mem, len);
        if (card->dmarx_in_progress) {
                dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n");
        }
 
-       outl((unsigned long) skb, card->pci_conf + DMAPADR0);   /* Copy to here */
-       outl((unsigned long) mem, card->pci_conf + DMALADR0);   /* from here */
+       outl(skb, card->pci_conf + DMAPADR0);   /* Copy to here */
+       outl(mem, card->pci_conf + DMALADR0);   /* from here */
        outl(len, card->pci_conf + DMASIZ0);    /* for this length */
        outl(0x00000000c, card->pci_conf + DMADPR0);    /* In this direction */
 
@@ -1309,8 +1311,8 @@ fst_intr_rx(struct fst_card_info *card, struct fst_port_info *port)
                card->dma_port_rx = port;
                card->dma_len_rx = len;
                card->dma_rxpos = rxp;
-               fst_rx_dma(card, (char *) card->rx_dma_handle_card,
-                          (char *) BUF_OFFSET(rxBuffer[pi][rxp][0]), len);
+               fst_rx_dma(card, card->rx_dma_handle_card,
+                          BUF_OFFSET(rxBuffer[pi][rxp][0]), len);
        }
        if (rxp != port->rxpos) {
                dbg(DBG_ASS, "About to increment rxpos by more than 1\n");
@@ -1663,10 +1665,9 @@ check_started_ok(struct fst_card_info *card)
         * existing firmware etc so we just report it for the moment.
         */
        if (FST_RDL(card, numberOfPorts) != card->nports) {
-               pr_warning("Port count mismatch on card %d. "
-                          "Firmware thinks %d we say %d\n",
-                          card->card_no,
-                          FST_RDL(card, numberOfPorts), card->nports);
+               pr_warn("Port count mismatch on card %d.  Firmware thinks %d we say %d\n",
+                       card->card_no,
+                       FST_RDL(card, numberOfPorts), card->nports);
        }
 }
 
@@ -2202,8 +2203,10 @@ fst_open(struct net_device *dev)
 
        if (port->mode != FST_RAW) {
                err = hdlc_open(dev);
-               if (err)
+               if (err) {
+                       module_put(THIS_MODULE);
                        return err;
+               }
        }
 
        fst_openport(port);