summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musb_core.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@nokia.com>2008-11-24 14:06:53 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-07 21:00:01 +0300
commitc48a5155252fd9cba7bedc59e5f8a339a3454d58 (patch)
tree6de25e14731e56ba0ddf5b07d137237be40e9ba5 /drivers/usb/musb/musb_core.c
parentb6a49b8490fe6f22f0027a3f05eb498918f09303 (diff)
downloadlinux-c48a5155252fd9cba7bedc59e5f8a339a3454d58.tar.xz
USB: musb: check if set_irq_wake succeded and remember it
Without it, in platforms that don't provide irq_chip.set_wake(), like omap, musb will WARN() on driver removal. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r--drivers/usb/musb/musb_core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 8b14437331c7..83720f61fdba 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1840,7 +1840,7 @@ static void musb_free(struct musb *musb)
musb_gadget_cleanup(musb);
#endif
- if (musb->nIrq >= 0) {
+ if (musb->nIrq >= 0 && musb->irq_wake) {
disable_irq_wake(musb->nIrq);
free_irq(musb->nIrq, musb);
}
@@ -1993,8 +1993,12 @@ bad_config:
}
musb->nIrq = nIrq;
/* FIXME this handles wakeup irqs wrong */
- if (enable_irq_wake(nIrq) == 0)
+ if (enable_irq_wake(nIrq) == 0) {
+ musb->irq_wake = 1;
device_init_wakeup(dev, 1);
+ } else {
+ musb->irq_wake = 0;
+ }
pr_info("%s: USB %s mode controller at %p using %s, IRQ %d\n",
musb_driver_name,