Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200892
b: refs/heads/master
c: dfe1e8e
h: refs/heads/master
v: v3
  • Loading branch information
Denis Kirjanov authored and David S. Miller committed Jul 7, 2010
1 parent dd99a7e commit 06fa6fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: 17762060c25590bfddd68cc1131f28ec720f405f
refs/heads/master: dfe1e8eddcd73fc58124933c14c2efe93fab0b8f
18 changes: 13 additions & 5 deletions trunk/drivers/net/ll_temac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
np = of_parse_phandle(op->dev.of_node, "llink-connected", 0);
if (!np) {
dev_err(&op->dev, "could not find DMA node\n");
goto nodev;
goto err_iounmap;
}

/* Setup the DMA register accesses, could be DCR or memory mapped */
Expand All @@ -978,7 +978,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs);
} else {
dev_err(&op->dev, "unable to map DMA registers\n");
goto nodev;
goto err_iounmap;
}
}

Expand All @@ -987,7 +987,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) {
dev_err(&op->dev, "could not determine irqs\n");
rc = -ENOMEM;
goto nodev;
goto err_iounmap_2;
}

of_node_put(np); /* Finished with the DMA node; drop the reference */
Expand All @@ -997,7 +997,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
if ((!addr) || (size != 6)) {
dev_err(&op->dev, "could not find MAC address\n");
rc = -ENODEV;
goto nodev;
goto err_iounmap_2;
}
temac_set_mac_address(ndev, (void *)addr);

Expand All @@ -1013,7 +1013,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group);
if (rc) {
dev_err(lp->dev, "Error creating sysfs files\n");
goto nodev;
goto err_iounmap_2;
}

rc = register_netdev(lp->ndev);
Expand All @@ -1026,6 +1026,11 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)

err_register_ndev:
sysfs_remove_group(&lp->dev->kobj, &temac_attr_group);
err_iounmap_2:
if (lp->sdma_regs)
iounmap(lp->sdma_regs);
err_iounmap:
iounmap(lp->regs);
nodev:
free_netdev(ndev);
ndev = NULL;
Expand All @@ -1044,6 +1049,9 @@ static int __devexit temac_of_remove(struct of_device *op)
of_node_put(lp->phy_node);
lp->phy_node = NULL;
dev_set_drvdata(&op->dev, NULL);
iounmap(lp->regs);
if (lp->sdma_regs)
iounmap(lp->sdma_regs);
free_netdev(ndev);
return 0;
}
Expand Down

0 comments on commit 06fa6fa

Please sign in to comment.