Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93115
b: refs/heads/master
c: e3152ab
h: refs/heads/master
i:
  93113: 3462775
  93111: e308d8e
v: v3
  • Loading branch information
Francois Romieu authored and Jeff Garzik committed Apr 25, 2008
1 parent 0a2e036 commit 34f6d9a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 751c2e4755027468a79349f8e9f4885a4518426e
refs/heads/master: e3152ab901bcec132639d123b0e7c2b5ed237957
35 changes: 16 additions & 19 deletions trunk/drivers/net/korina.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ static int korina_init(struct net_device *dev)
static int korina_restart(struct net_device *dev)
{
struct korina_private *lp = netdev_priv(dev);
int ret = 0;
int ret;

/*
* Disable interrupts
Expand Down Expand Up @@ -987,7 +987,7 @@ static void korina_poll_controller(struct net_device *dev)
static int korina_open(struct net_device *dev)
{
struct korina_private *lp = netdev_priv(dev);
int ret = 0;
int ret;

/* Initialize */
ret = korina_init(dev);
Expand Down Expand Up @@ -1082,7 +1082,7 @@ static int korina_probe(struct platform_device *pdev)
struct korina_private *lp;
struct net_device *dev;
struct resource *r;
int retval, err;
int rc;

dev = alloc_etherdev(sizeof(struct korina_private));
if (!dev) {
Expand All @@ -1106,30 +1106,30 @@ static int korina_probe(struct platform_device *pdev)
lp->eth_regs = ioremap_nocache(r->start, r->end - r->start);
if (!lp->eth_regs) {
printk(KERN_ERR DRV_NAME "cannot remap registers\n");
retval = -ENXIO;
rc = -ENXIO;
goto probe_err_out;
}

r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_rx");
lp->rx_dma_regs = ioremap_nocache(r->start, r->end - r->start);
if (!lp->rx_dma_regs) {
printk(KERN_ERR DRV_NAME "cannot remap Rx DMA registers\n");
retval = -ENXIO;
rc = -ENXIO;
goto probe_err_dma_rx;
}

r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_dma_tx");
lp->tx_dma_regs = ioremap_nocache(r->start, r->end - r->start);
if (!lp->tx_dma_regs) {
printk(KERN_ERR DRV_NAME "cannot remap Tx DMA registers\n");
retval = -ENXIO;
rc = -ENXIO;
goto probe_err_dma_tx;
}

lp->td_ring = kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
if (!lp->td_ring) {
printk(KERN_ERR DRV_NAME "cannot allocate descriptors\n");
retval = -ENOMEM;
rc = -ENXIO;
goto probe_err_td_ring;
}

Expand Down Expand Up @@ -1166,14 +1166,14 @@ static int korina_probe(struct platform_device *pdev)
lp->mii_if.phy_id_mask = 0x1f;
lp->mii_if.reg_num_mask = 0x1f;

err = register_netdev(dev);
if (err) {
rc = register_netdev(dev);
if (rc < 0) {
printk(KERN_ERR DRV_NAME
": cannot register net device %d\n", err);
retval = -EINVAL;
": cannot register net device %d\n", rc);
goto probe_err_register;
}
return 0;
out:
return rc;

probe_err_register:
kfree(lp->td_ring);
Expand All @@ -1185,20 +1185,17 @@ static int korina_probe(struct platform_device *pdev)
iounmap(lp->eth_regs);
probe_err_out:
free_netdev(dev);
return retval;
goto out;
}

static int korina_remove(struct platform_device *pdev)
{
struct korina_device *bif = platform_get_drvdata(pdev);
struct korina_private *lp = netdev_priv(bif->dev);

if (lp->eth_regs)
iounmap(lp->eth_regs);
if (lp->rx_dma_regs)
iounmap(lp->rx_dma_regs);
if (lp->tx_dma_regs)
iounmap(lp->tx_dma_regs);
iounmap(lp->eth_regs);
iounmap(lp->rx_dma_regs);
iounmap(lp->tx_dma_regs);

platform_set_drvdata(pdev, NULL);
unregister_netdev(bif->dev);
Expand Down

0 comments on commit 34f6d9a

Please sign in to comment.