aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJamie Iles <jamie@jamieiles.com>2011-03-08 15:19:23 -0500
committerJamie Iles <jamie@jamieiles.com>2011-11-22 10:21:16 -0500
commit461845db2176d2e11b45f1f24cbd0ed8ddf26fcb (patch)
treefe6779b8117669ba621fede02cb1aa7fdadd93d0 /drivers/net
parent865d605ee81813dc73d5422fd2f9bd132d10d194 (diff)
macb: remove conditional clk handling
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/cadence/macb.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index a437b46e5490..b0fa47870add 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1152,28 +1152,19 @@ static int __init macb_probe(struct platform_device *pdev)
1152 1152
1153 spin_lock_init(&bp->lock); 1153 spin_lock_init(&bp->lock);
1154 1154
1155#if defined(CONFIG_ARCH_AT91) 1155 bp->pclk = clk_get(&pdev->dev, "pclk");
1156 bp->pclk = clk_get(&pdev->dev, "macb_clk");
1157 if (IS_ERR(bp->pclk)) { 1156 if (IS_ERR(bp->pclk)) {
1158 dev_err(&pdev->dev, "failed to get macb_clk\n"); 1157 dev_err(&pdev->dev, "failed to get macb_clk\n");
1159 goto err_out_free_dev; 1158 goto err_out_free_dev;
1160 } 1159 }
1161 clk_enable(bp->pclk); 1160 clk_enable(bp->pclk);
1162#else 1161
1163 bp->pclk = clk_get(&pdev->dev, "pclk");
1164 if (IS_ERR(bp->pclk)) {
1165 dev_err(&pdev->dev, "failed to get pclk\n");
1166 goto err_out_free_dev;
1167 }
1168 bp->hclk = clk_get(&pdev->dev, "hclk"); 1162 bp->hclk = clk_get(&pdev->dev, "hclk");
1169 if (IS_ERR(bp->hclk)) { 1163 if (IS_ERR(bp->hclk)) {
1170 dev_err(&pdev->dev, "failed to get hclk\n"); 1164 dev_err(&pdev->dev, "failed to get hclk\n");
1171 goto err_out_put_pclk; 1165 goto err_out_put_pclk;
1172 } 1166 }
1173
1174 clk_enable(bp->pclk);
1175 clk_enable(bp->hclk); 1167 clk_enable(bp->hclk);
1176#endif
1177 1168
1178 bp->regs = ioremap(regs->start, resource_size(regs)); 1169 bp->regs = ioremap(regs->start, resource_size(regs));
1179 if (!bp->regs) { 1170 if (!bp->regs) {
@@ -1256,14 +1247,10 @@ err_out_free_irq:
1256err_out_iounmap: 1247err_out_iounmap:
1257 iounmap(bp->regs); 1248 iounmap(bp->regs);
1258err_out_disable_clocks: 1249err_out_disable_clocks:
1259#ifndef CONFIG_ARCH_AT91
1260 clk_disable(bp->hclk); 1250 clk_disable(bp->hclk);
1261 clk_put(bp->hclk); 1251 clk_put(bp->hclk);
1262#endif
1263 clk_disable(bp->pclk); 1252 clk_disable(bp->pclk);
1264#ifndef CONFIG_ARCH_AT91
1265err_out_put_pclk: 1253err_out_put_pclk:
1266#endif
1267 clk_put(bp->pclk); 1254 clk_put(bp->pclk);
1268err_out_free_dev: 1255err_out_free_dev:
1269 free_netdev(dev); 1256 free_netdev(dev);
@@ -1289,10 +1276,8 @@ static int __exit macb_remove(struct platform_device *pdev)
1289 unregister_netdev(dev); 1276 unregister_netdev(dev);
1290 free_irq(dev->irq, dev); 1277 free_irq(dev->irq, dev);
1291 iounmap(bp->regs); 1278 iounmap(bp->regs);
1292#ifndef CONFIG_ARCH_AT91
1293 clk_disable(bp->hclk); 1279 clk_disable(bp->hclk);
1294 clk_put(bp->hclk); 1280 clk_put(bp->hclk);
1295#endif
1296 clk_disable(bp->pclk); 1281 clk_disable(bp->pclk);
1297 clk_put(bp->pclk); 1282 clk_put(bp->pclk);
1298 free_netdev(dev); 1283 free_netdev(dev);
@@ -1310,9 +1295,7 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state)
1310 1295
1311 netif_device_detach(netdev); 1296 netif_device_detach(netdev);
1312 1297
1313#ifndef CONFIG_ARCH_AT91
1314 clk_disable(bp->hclk); 1298 clk_disable(bp->hclk);
1315#endif
1316 clk_disable(bp->pclk); 1299 clk_disable(bp->pclk);
1317 1300
1318 return 0; 1301 return 0;
@@ -1324,9 +1307,7 @@ static int macb_resume(struct platform_device *pdev)
1324 struct macb *bp = netdev_priv(netdev); 1307 struct macb *bp = netdev_priv(netdev);
1325 1308
1326 clk_enable(bp->pclk); 1309 clk_enable(bp->pclk);
1327#ifndef CONFIG_ARCH_AT91
1328 clk_enable(bp->hclk); 1310 clk_enable(bp->hclk);
1329#endif
1330 1311
1331 netif_device_attach(netdev); 1312 netif_device_attach(netdev);
1332 1313