drivers/net/r6040: fix obvious problems (but more remain)

- checkpatch fixes

- fix bogus and uninitialized return codes in r6040_start_xmit()

- netdev_get_settings() fix obvious locking bug flagged by compiler warning

- set DMA consistent mask

- remove unnecessary setting of dev->base_addr

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index edce5a4..1d7efa2 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -42,12 +42,12 @@
 #include <linux/ethtool.h>
 #include <linux/crc32.h>
 #include <linux/spinlock.h>
+#include <linux/bitops.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/uaccess.h>
 
 #include <asm/processor.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
 
 #define DRV_NAME	"r6040"
 #define DRV_VERSION	"0.16"
@@ -181,7 +181,7 @@
 	": RDC R6040 NAPI net driver,"
 	"version "DRV_VERSION " (" DRV_RELDATE ")\n";
 
-static int phy_table[] = { PHY1_ADDR, PHY2_ADDR};
+static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };
 
 /* Read a word data from PHY Chip */
 static int phy_read(void __iomem *ioaddr, int phy_addr, int reg)
@@ -771,15 +771,7 @@
 	struct r6040_descriptor *descptr;
 	void __iomem *ioaddr = lp->base;
 	unsigned long flags;
-	int ret;
-
-	if (!skb)	/* NULL skb directly return */
-		return ret;
-
-	if (skb->len >= MAX_BUF_SIZE) {	/* Packet too long, drop it */
-		dev_kfree_skb(skb);
-		return ret;
-	}
+	int ret = NETDEV_TX_OK;
 
 	/* Critical Section */
 	spin_lock_irqsave(&lp->lock, flags);
@@ -787,8 +779,9 @@
 	/* TX resource check */
 	if (!lp->tx_free_desc) {
 		spin_unlock_irqrestore(&lp->lock, flags);
+		netif_stop_queue(dev);
 		printk(KERN_ERR DRV_NAME ": no tx descriptor\n");
-		ret = 1;
+		ret = NETDEV_TX_BUSY;
 		return ret;
 	}
 
@@ -916,7 +909,7 @@
 
 	spin_lock_irq(&rp->lock);
 	rc = mii_ethtool_gset(&rp->mii_if, cmd);
-	spin_unlock_irq(&rp->mii_if);
+	spin_unlock_irq(&rp->lock);
 
 	return rc;
 }
@@ -973,6 +966,11 @@
 				"not supported by the card\n");
 		return -ENODEV;
 	}
+	if (pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) {
+		printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses"
+				"not supported by the card\n");
+		return -ENODEV;
+	}
 
 	/* IO Size check */
 	if (pci_resource_len(pdev, 0) < io_size) {
@@ -1006,7 +1004,6 @@
 	}
 
 	/* Init system & device */
-	dev->base_addr = (unsigned long)ioaddr;
 	lp->base = ioaddr;
 	dev->irq = pdev->irq;