提交 5ac5d616 编写于 作者: F Francois Romieu 提交者: David S. Miller

r6040: cleanups

- whitespaces vs tabs
- use 80 cols
- use if_mii
- use netdev_priv
- remove useless cast to void *
- PCI device id does not need to be globally available
Signed-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
上级 e6a9ea10
...@@ -235,8 +235,7 @@ static void mdio_write(struct net_device *dev, int mii_id, int reg, int val) ...@@ -235,8 +235,7 @@ static void mdio_write(struct net_device *dev, int mii_id, int reg, int val)
phy_write(ioaddr, lp->phy_addr, reg, val); phy_write(ioaddr, lp->phy_addr, reg, val);
} }
static void static void r6040_tx_timeout(struct net_device *dev)
r6040_tx_timeout(struct net_device *dev)
{ {
struct r6040_private *priv = netdev_priv(dev); struct r6040_private *priv = netdev_priv(dev);
...@@ -341,8 +340,7 @@ static void r6040_down(struct net_device *dev) ...@@ -341,8 +340,7 @@ static void r6040_down(struct net_device *dev)
pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma); pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma);
} }
static int static int r6040_close(struct net_device *dev)
r6040_close(struct net_device *dev)
{ {
struct r6040_private *lp = netdev_priv(dev); struct r6040_private *lp = netdev_priv(dev);
...@@ -405,7 +403,7 @@ static void r6040_set_carrier(struct mii_if_info *mii) ...@@ -405,7 +403,7 @@ static void r6040_set_carrier(struct mii_if_info *mii)
static int r6040_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int r6040_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
struct r6040_private *lp = netdev_priv(dev); struct r6040_private *lp = netdev_priv(dev);
struct mii_ioctl_data *data = (struct mii_ioctl_data *) &rq->ifr_data; struct mii_ioctl_data *data = if_mii(rq);
int rc; int rc;
if (!netif_running(dev)) if (!netif_running(dev))
...@@ -574,12 +572,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -574,12 +572,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
static void r6040_poll_controller(struct net_device *dev) static void r6040_poll_controller(struct net_device *dev)
{ {
disable_irq(dev->irq); disable_irq(dev->irq);
r6040_interrupt(dev->irq, (void *)dev); r6040_interrupt(dev->irq, dev);
enable_irq(dev->irq); enable_irq(dev->irq);
} }
#endif #endif
static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring, static void r6040_init_ring_desc(struct r6040_descriptor *desc_ring,
dma_addr_t desc_dma, int size) dma_addr_t desc_dma, int size)
{ {
...@@ -716,10 +713,9 @@ static void r6040_mac_address(struct net_device *dev) ...@@ -716,10 +713,9 @@ static void r6040_mac_address(struct net_device *dev)
iowrite16(adrp[2], ioaddr + MID_0H); iowrite16(adrp[2], ioaddr + MID_0H);
} }
static int static int r6040_open(struct net_device *dev)
r6040_open(struct net_device *dev)
{ {
struct r6040_private *lp = dev->priv; struct r6040_private *lp = netdev_priv(dev);
int ret; int ret;
/* Request IRQ and Register interrupt handler */ /* Request IRQ and Register interrupt handler */
...@@ -761,8 +757,7 @@ r6040_open(struct net_device *dev) ...@@ -761,8 +757,7 @@ r6040_open(struct net_device *dev)
return 0; return 0;
} }
static int static int r6040_start_xmit(struct sk_buff *skb, struct net_device *dev)
r6040_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct r6040_private *lp = netdev_priv(dev); struct r6040_private *lp = netdev_priv(dev);
struct r6040_descriptor *descptr; struct r6040_descriptor *descptr;
...@@ -810,8 +805,7 @@ r6040_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -810,8 +805,7 @@ r6040_start_xmit(struct sk_buff *skb, struct net_device *dev)
return ret; return ret;
} }
static void static void r6040_multicast_list(struct net_device *dev)
r6040_multicast_list(struct net_device *dev)
{ {
struct r6040_private *lp = netdev_priv(dev); struct r6040_private *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base; void __iomem *ioaddr = lp->base;
...@@ -938,7 +932,6 @@ static struct ethtool_ops netdev_ethtool_ops = { ...@@ -938,7 +932,6 @@ static struct ethtool_ops netdev_ethtool_ops = {
.get_link = netdev_get_link, .get_link = netdev_get_link,
}; };
static int __devinit r6040_init_one(struct pci_dev *pdev, static int __devinit r6040_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
...@@ -1075,13 +1068,13 @@ static void __devexit r6040_remove_one(struct pci_dev *pdev) ...@@ -1075,13 +1068,13 @@ static void __devexit r6040_remove_one(struct pci_dev *pdev)
static struct pci_device_id r6040_pci_tbl[] = { static struct pci_device_id r6040_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6040) }, { PCI_DEVICE(PCI_VENDOR_ID_RDC, 0x6040) },
{0 } { 0 }
}; };
MODULE_DEVICE_TABLE(pci, r6040_pci_tbl); MODULE_DEVICE_TABLE(pci, r6040_pci_tbl);
static struct pci_driver r6040_driver = { static struct pci_driver r6040_driver = {
.name = "r6040", .name = DRV_NAME,
.id_table = r6040_pci_tbl, .id_table = r6040_pci_tbl,
.probe = r6040_init_one, .probe = r6040_init_one,
.remove = __devexit_p(r6040_remove_one), .remove = __devexit_p(r6040_remove_one),
......
...@@ -2111,7 +2111,6 @@ ...@@ -2111,7 +2111,6 @@
#define PCI_DEVICE_ID_HERC_UNI 0x5832 #define PCI_DEVICE_ID_HERC_UNI 0x5832
#define PCI_VENDOR_ID_RDC 0x17f3 #define PCI_VENDOR_ID_RDC 0x17f3
#define PCI_DEVICE_ID_RDC_R6040 0x6040
#define PCI_VENDOR_ID_SITECOM 0x182d #define PCI_VENDOR_ID_SITECOM 0x182d
#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 #define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册