Commit 193aa41e authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by David S. Miller

[IRDA]: Stir driver suspend fix

<Patch from Stephen Hemminger>

o [FEATURE] stir4200: don't need suspend/resume if !CONFIG_PM

The suspend/resume code only needs to be compiled in if power management
is enabled.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72e0661c
...@@ -761,8 +761,9 @@ static int stir_transmit_thread(void *arg) ...@@ -761,8 +761,9 @@ static int stir_transmit_thread(void *arg)
&& netif_device_present(dev) && netif_device_present(dev)
&& !signal_pending(current)) && !signal_pending(current))
{ {
#ifdef CONFIG_PM
/* if suspending, then power off and wait */ /* if suspending, then power off and wait */
if (current->flags & PF_FREEZE) { if (unlikely(current->flags & PF_FREEZE)) {
if (stir->receiving) if (stir->receiving)
receive_stop(stir); receive_stop(stir);
else else
...@@ -775,6 +776,7 @@ static int stir_transmit_thread(void *arg) ...@@ -775,6 +776,7 @@ static int stir_transmit_thread(void *arg)
if (change_speed(stir, stir->speed)) if (change_speed(stir, stir->speed))
break; break;
} }
#endif
/* if something to send? */ /* if something to send? */
skb = xchg(&stir->tx_pending, NULL); skb = xchg(&stir->tx_pending, NULL);
...@@ -1125,7 +1127,7 @@ static void stir_disconnect(struct usb_interface *intf) ...@@ -1125,7 +1127,7 @@ static void stir_disconnect(struct usb_interface *intf)
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
} }
#ifdef CONFIG_PM
/* Power management suspend, so power off the transmitter/receiver */ /* Power management suspend, so power off the transmitter/receiver */
static int stir_suspend(struct usb_interface *intf, u32 state) static int stir_suspend(struct usb_interface *intf, u32 state)
{ {
...@@ -1145,6 +1147,7 @@ static int stir_resume(struct usb_interface *intf) ...@@ -1145,6 +1147,7 @@ static int stir_resume(struct usb_interface *intf)
/* receiver restarted when send thread wakes up */ /* receiver restarted when send thread wakes up */
return 0; return 0;
} }
#endif
/* /*
* USB device callbacks * USB device callbacks
...@@ -1155,8 +1158,10 @@ static struct usb_driver irda_driver = { ...@@ -1155,8 +1158,10 @@ static struct usb_driver irda_driver = {
.probe = stir_probe, .probe = stir_probe,
.disconnect = stir_disconnect, .disconnect = stir_disconnect,
.id_table = dongles, .id_table = dongles,
#ifdef CONFIG_PM
.suspend = stir_suspend, .suspend = stir_suspend,
.resume = stir_resume, .resume = stir_resume,
#endif
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment