aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-18 05:39:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-18 05:39:39 -0400
commit49997d75152b3d23c53b0fa730599f2f74c92c65 (patch)
tree46e93126170d02cfec9505172e545732c1b69656 /drivers/net/macb.c
parenta0c80b80e0fb48129e4e9d6a9ede914f9ff1850d (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: Documentation/powerpc/booting-without-of.txt drivers/atm/Makefile drivers/net/fs_enet/fs_enet-main.c drivers/pci/pci-acpi.c net/8021q/vlan.c net/iucv/iucv.c
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 50688a52658e..0496d16f9de5 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1281,8 +1281,45 @@ static int __exit macb_remove(struct platform_device *pdev)
1281 return 0; 1281 return 0;
1282} 1282}
1283 1283
1284#ifdef CONFIG_PM
1285static int macb_suspend(struct platform_device *pdev, pm_message_t state)
1286{
1287 struct net_device *netdev = platform_get_drvdata(pdev);
1288 struct macb *bp = netdev_priv(netdev);
1289
1290 netif_device_detach(netdev);
1291
1292#ifndef CONFIG_ARCH_AT91
1293 clk_disable(bp->hclk);
1294#endif
1295 clk_disable(bp->pclk);
1296
1297 return 0;
1298}
1299
1300static int macb_resume(struct platform_device *pdev)
1301{
1302 struct net_device *netdev = platform_get_drvdata(pdev);
1303 struct macb *bp = netdev_priv(netdev);
1304
1305 clk_enable(bp->pclk);
1306#ifndef CONFIG_ARCH_AT91
1307 clk_enable(bp->hclk);
1308#endif
1309
1310 netif_device_attach(netdev);
1311
1312 return 0;
1313}
1314#else
1315#define macb_suspend NULL
1316#define macb_resume NULL
1317#endif
1318
1284static struct platform_driver macb_driver = { 1319static struct platform_driver macb_driver = {
1285 .remove = __exit_p(macb_remove), 1320 .remove = __exit_p(macb_remove),
1321 .suspend = macb_suspend,
1322 .resume = macb_resume,
1286 .driver = { 1323 .driver = {
1287 .name = "macb", 1324 .name = "macb",
1288 .owner = THIS_MODULE, 1325 .owner = THIS_MODULE,