Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225215
b: refs/heads/master
c: 34a52f3
h: refs/heads/master
i:
  225213: a333229
  225211: 3355d9a
  225207: 82d9c3e
  225199: 4e4a6d4
  225183: 84fde30
  225151: 47ffeee
v: v3
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Dec 21, 2010
1 parent 1cdb710 commit 59d2f1e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 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: 4b97f8e10893e2c8f64a2795901bdb447a3308f4
refs/heads/master: 34a52f363ab6bcf6d50a65c153dec03f3fb32653
50 changes: 25 additions & 25 deletions trunk/drivers/net/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,33 +1647,30 @@ static int stmmac_dvr_probe(struct platform_device *pdev)

pr_info("STMMAC driver:\n\tplatform registration... ");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
ret = -ENODEV;
goto out;
}
if (!res)
return -ENODEV;
pr_info("\tdone!\n");

if (!request_mem_region(res->start, resource_size(res),
pdev->name)) {
pr_err("%s: ERROR: memory allocation failed"
"cannot get the I/O addr 0x%x\n",
__func__, (unsigned int)res->start);
ret = -EBUSY;
goto out;
return -EBUSY;
}

addr = ioremap(res->start, resource_size(res));
if (!addr) {
pr_err("%s: ERROR: memory mapping failed\n", __func__);
ret = -ENOMEM;
goto out;
goto out_release_region;
}

ndev = alloc_etherdev(sizeof(struct stmmac_priv));
if (!ndev) {
pr_err("%s: ERROR: allocating the device\n", __func__);
ret = -ENOMEM;
goto out;
goto out_unmap;
}

SET_NETDEV_DEV(ndev, &pdev->dev);
Expand All @@ -1683,8 +1680,8 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
if (ndev->irq == -ENXIO) {
pr_err("%s: ERROR: MAC IRQ configuration "
"information not found\n", __func__);
ret = -ENODEV;
goto out;
ret = -ENXIO;
goto out_free_ndev;
}

priv = netdev_priv(ndev);
Expand All @@ -1711,26 +1708,26 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
if (priv->plat->init) {
ret = priv->plat->init(pdev);
if (unlikely(ret))
goto out;
goto out_free_ndev;
}

/* MAC HW revice detection */
ret = stmmac_mac_device_setup(ndev);
if (ret < 0)
goto out;
goto out_plat_exit;

/* Network Device Registration */
ret = stmmac_probe(ndev);
if (ret < 0)
goto out;
goto out_plat_exit;

/* associate a PHY - it is provided by another platform bus */
if (!driver_for_each_device
(&(stmmacphy_driver.driver), NULL, (void *)priv,
stmmac_associate_phy)) {
pr_err("No PHY device is associated with this MAC!\n");
ret = -ENODEV;
goto out;
goto out_unregister;
}

pr_info("\t%s - (dev. name: %s - id: %d, IRQ #%d\n"
Expand All @@ -1741,19 +1738,22 @@ static int stmmac_dvr_probe(struct platform_device *pdev)
pr_debug("\tMDIO bus (id: %d)...", priv->plat->bus_id);
ret = stmmac_mdio_register(ndev);
if (ret < 0)
goto out;
goto out_unregister;
pr_debug("registered!\n");
return 0;

out:
if (ret < 0) {
if (priv->plat->exit)
priv->plat->exit(pdev);

platform_set_drvdata(pdev, NULL);
release_mem_region(res->start, resource_size(res));
if (addr != NULL)
iounmap(addr);
}
out_unregister:
unregister_netdev(ndev);
out_plat_exit:
if (priv->plat->exit)
priv->plat->exit(pdev);
out_free_ndev:
free_netdev(ndev);
platform_set_drvdata(pdev, NULL);
out_unmap:
iounmap(addr);
out_release_region:
release_mem_region(res->start, resource_size(res));

return ret;
}
Expand Down

0 comments on commit 59d2f1e

Please sign in to comment.