diff options
-rw-r--r-- | drivers/net/bfin_mac.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index ead7be969975..5cb4433d5612 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -672,7 +672,7 @@ static void bf537mac_poll(struct net_device *dev) | |||
672 | } | 672 | } |
673 | #endif /* CONFIG_NET_POLL_CONTROLLER */ | 673 | #endif /* CONFIG_NET_POLL_CONTROLLER */ |
674 | 674 | ||
675 | static void bf537mac_reset(void) | 675 | static void bf537mac_disable(void) |
676 | { | 676 | { |
677 | unsigned int opmode; | 677 | unsigned int opmode; |
678 | 678 | ||
@@ -730,7 +730,7 @@ static void bf537mac_timeout(struct net_device *dev) | |||
730 | { | 730 | { |
731 | pr_debug("%s: %s\n", dev->name, __FUNCTION__); | 731 | pr_debug("%s: %s\n", dev->name, __FUNCTION__); |
732 | 732 | ||
733 | bf537mac_reset(); | 733 | bf537mac_disable(); |
734 | 734 | ||
735 | /* reset tx queue */ | 735 | /* reset tx queue */ |
736 | tx_list_tail = tx_list_head->next; | 736 | tx_list_tail = tx_list_head->next; |
@@ -810,7 +810,7 @@ static int bf537mac_open(struct net_device *dev) | |||
810 | 810 | ||
811 | bf537mac_setphy(dev); | 811 | bf537mac_setphy(dev); |
812 | setup_system_regs(dev); | 812 | setup_system_regs(dev); |
813 | bf537mac_reset(); | 813 | bf537mac_disable(); |
814 | bf537mac_enable(dev); | 814 | bf537mac_enable(dev); |
815 | 815 | ||
816 | pr_debug("hardware init finished\n"); | 816 | pr_debug("hardware init finished\n"); |
@@ -968,15 +968,30 @@ static int bfin_mac_remove(struct platform_device *pdev) | |||
968 | return 0; | 968 | return 0; |
969 | } | 969 | } |
970 | 970 | ||
971 | static int bfin_mac_suspend(struct platform_device *pdev, pm_message_t state) | 971 | #ifdef CONFIG_PM |
972 | static int bfin_mac_suspend(struct platform_device *pdev, pm_message_t mesg) | ||
972 | { | 973 | { |
974 | struct net_device *net_dev = platform_get_drvdata(pdev); | ||
975 | |||
976 | if (netif_running(net_dev)) | ||
977 | bf537mac_close(net_dev); | ||
978 | |||
973 | return 0; | 979 | return 0; |
974 | } | 980 | } |
975 | 981 | ||
976 | static int bfin_mac_resume(struct platform_device *pdev) | 982 | static int bfin_mac_resume(struct platform_device *pdev) |
977 | { | 983 | { |
984 | struct net_device *net_dev = platform_get_drvdata(pdev); | ||
985 | |||
986 | if (netif_running(net_dev)) | ||
987 | bf537mac_open(net_dev); | ||
988 | |||
978 | return 0; | 989 | return 0; |
979 | } | 990 | } |
991 | #else | ||
992 | #define bfin_mac_suspend NULL | ||
993 | #define bfin_mac_resume NULL | ||
994 | #endif /* CONFIG_PM */ | ||
980 | 995 | ||
981 | static struct platform_driver bfin_mac_driver = { | 996 | static struct platform_driver bfin_mac_driver = { |
982 | .probe = bfin_mac_probe, | 997 | .probe = bfin_mac_probe, |