Commit 0a4acf08 authored by Soren Brinkmann's avatar Soren Brinkmann Committed by David S. Miller

net: macb: Use devm_request_irq()

Use the device managed interface to request the IRQ, simplifying error
paths.
Signed-off-by: default avatarSoren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60fe716f
...@@ -1825,7 +1825,8 @@ static int __init macb_probe(struct platform_device *pdev) ...@@ -1825,7 +1825,8 @@ static int __init macb_probe(struct platform_device *pdev)
} }
dev->irq = platform_get_irq(pdev, 0); dev->irq = platform_get_irq(pdev, 0);
err = request_irq(dev->irq, macb_interrupt, 0, dev->name, dev); err = devm_request_irq(&pdev->dev, dev->irq, macb_interrupt, 0,
dev->name, dev);
if (err) { if (err) {
dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n", dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n",
dev->irq, err); dev->irq, err);
...@@ -1892,7 +1893,7 @@ static int __init macb_probe(struct platform_device *pdev) ...@@ -1892,7 +1893,7 @@ static int __init macb_probe(struct platform_device *pdev)
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
dev_err(&pdev->dev, "Cannot register net device, aborting.\n"); dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
goto err_out_free_irq; goto err_out_disable_clocks;
} }
err = macb_mii_init(bp); err = macb_mii_init(bp);
...@@ -1915,8 +1916,6 @@ static int __init macb_probe(struct platform_device *pdev) ...@@ -1915,8 +1916,6 @@ static int __init macb_probe(struct platform_device *pdev)
err_out_unregister_netdev: err_out_unregister_netdev:
unregister_netdev(dev); unregister_netdev(dev);
err_out_free_irq:
free_irq(dev->irq, dev);
err_out_disable_clocks: err_out_disable_clocks:
clk_disable_unprepare(bp->hclk); clk_disable_unprepare(bp->hclk);
err_out_disable_pclk: err_out_disable_pclk:
...@@ -1942,7 +1941,6 @@ static int __exit macb_remove(struct platform_device *pdev) ...@@ -1942,7 +1941,6 @@ static int __exit macb_remove(struct platform_device *pdev)
kfree(bp->mii_bus->irq); kfree(bp->mii_bus->irq);
mdiobus_free(bp->mii_bus); mdiobus_free(bp->mii_bus);
unregister_netdev(dev); unregister_netdev(dev);
free_irq(dev->irq, dev);
clk_disable_unprepare(bp->hclk); clk_disable_unprepare(bp->hclk);
clk_disable_unprepare(bp->pclk); clk_disable_unprepare(bp->pclk);
free_netdev(dev); free_netdev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment