AT91 now provides both "pclk" and "hclk" aliases for the the macb
device so we can use the same clk handling paths for both AT91 and
AVR32.
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Tested-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
spin_lock_init(&bp->lock);
spin_lock_init(&bp->lock);
-#if defined(CONFIG_ARCH_AT91)
- bp->pclk = clk_get(&pdev->dev, "macb_clk");
+ bp->pclk = clk_get(&pdev->dev, "pclk");
if (IS_ERR(bp->pclk)) {
dev_err(&pdev->dev, "failed to get macb_clk\n");
goto err_out_free_dev;
}
clk_enable(bp->pclk);
if (IS_ERR(bp->pclk)) {
dev_err(&pdev->dev, "failed to get macb_clk\n");
goto err_out_free_dev;
}
clk_enable(bp->pclk);
-#else
- bp->pclk = clk_get(&pdev->dev, "pclk");
- if (IS_ERR(bp->pclk)) {
- dev_err(&pdev->dev, "failed to get pclk\n");
- goto err_out_free_dev;
- }
bp->hclk = clk_get(&pdev->dev, "hclk");
if (IS_ERR(bp->hclk)) {
dev_err(&pdev->dev, "failed to get hclk\n");
goto err_out_put_pclk;
}
bp->hclk = clk_get(&pdev->dev, "hclk");
if (IS_ERR(bp->hclk)) {
dev_err(&pdev->dev, "failed to get hclk\n");
goto err_out_put_pclk;
}
-
- clk_enable(bp->pclk);
bp->regs = ioremap(regs->start, resource_size(regs));
if (!bp->regs) {
bp->regs = ioremap(regs->start, resource_size(regs));
if (!bp->regs) {
err_out_iounmap:
iounmap(bp->regs);
err_out_disable_clocks:
err_out_iounmap:
iounmap(bp->regs);
err_out_disable_clocks:
-#ifndef CONFIG_ARCH_AT91
clk_disable(bp->hclk);
clk_put(bp->hclk);
clk_disable(bp->hclk);
clk_put(bp->hclk);
-#ifndef CONFIG_ARCH_AT91
clk_put(bp->pclk);
err_out_free_dev:
free_netdev(dev);
clk_put(bp->pclk);
err_out_free_dev:
free_netdev(dev);
unregister_netdev(dev);
free_irq(dev->irq, dev);
iounmap(bp->regs);
unregister_netdev(dev);
free_irq(dev->irq, dev);
iounmap(bp->regs);
-#ifndef CONFIG_ARCH_AT91
clk_disable(bp->hclk);
clk_put(bp->hclk);
clk_disable(bp->hclk);
clk_put(bp->hclk);
clk_disable(bp->pclk);
clk_put(bp->pclk);
free_netdev(dev);
clk_disable(bp->pclk);
clk_put(bp->pclk);
free_netdev(dev);
netif_device_detach(netdev);
netif_device_detach(netdev);
-#ifndef CONFIG_ARCH_AT91
clk_disable(bp->pclk);
return 0;
clk_disable(bp->pclk);
return 0;
struct macb *bp = netdev_priv(netdev);
clk_enable(bp->pclk);
struct macb *bp = netdev_priv(netdev);
clk_enable(bp->pclk);
-#ifndef CONFIG_ARCH_AT91
netif_device_attach(netdev);
netif_device_attach(netdev);