diff options
Diffstat (limited to 'drivers/net/irda/pxaficp_ir.c')
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c index aef80f5e7c9c..e1aa9910503b 100644 --- a/drivers/net/irda/pxaficp_ir.c +++ b/drivers/net/irda/pxaficp_ir.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/rtnetlink.h> | 22 | #include <linux/rtnetlink.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
25 | #include <linux/platform_device.h> | ||
25 | #include <linux/pm.h> | 26 | #include <linux/pm.h> |
26 | 27 | ||
27 | #include <net/irda/irda.h> | 28 | #include <net/irda/irda.h> |
@@ -704,15 +705,12 @@ static int pxa_irda_stop(struct net_device *dev) | |||
704 | return 0; | 705 | return 0; |
705 | } | 706 | } |
706 | 707 | ||
707 | static int pxa_irda_suspend(struct device *_dev, pm_message_t state, u32 level) | 708 | static int pxa_irda_suspend(struct device *_dev, pm_message_t state) |
708 | { | 709 | { |
709 | struct net_device *dev = dev_get_drvdata(_dev); | 710 | struct net_device *dev = dev_get_drvdata(_dev); |
710 | struct pxa_irda *si; | 711 | struct pxa_irda *si; |
711 | 712 | ||
712 | if (!dev || level != SUSPEND_DISABLE) | 713 | if (dev && netif_running(dev)) { |
713 | return 0; | ||
714 | |||
715 | if (netif_running(dev)) { | ||
716 | si = netdev_priv(dev); | 714 | si = netdev_priv(dev); |
717 | netif_device_detach(dev); | 715 | netif_device_detach(dev); |
718 | pxa_irda_shutdown(si); | 716 | pxa_irda_shutdown(si); |
@@ -721,15 +719,12 @@ static int pxa_irda_suspend(struct device *_dev, pm_message_t state, u32 level) | |||
721 | return 0; | 719 | return 0; |
722 | } | 720 | } |
723 | 721 | ||
724 | static int pxa_irda_resume(struct device *_dev, u32 level) | 722 | static int pxa_irda_resume(struct device *_dev) |
725 | { | 723 | { |
726 | struct net_device *dev = dev_get_drvdata(_dev); | 724 | struct net_device *dev = dev_get_drvdata(_dev); |
727 | struct pxa_irda *si; | 725 | struct pxa_irda *si; |
728 | 726 | ||
729 | if (!dev || level != RESUME_ENABLE) | 727 | if (dev && netif_running(dev)) { |
730 | return 0; | ||
731 | |||
732 | if (netif_running(dev)) { | ||
733 | si = netdev_priv(dev); | 728 | si = netdev_priv(dev); |
734 | pxa_irda_startup(si); | 729 | pxa_irda_startup(si); |
735 | netif_device_attach(dev); | 730 | netif_device_attach(dev); |