]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
USB: musb: check if set_irq_wake succeded and remember it
authorFelipe Balbi <felipe.balbi@nokia.com>
Mon, 24 Nov 2008 11:06:53 +0000 (13:06 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Jan 2009 18:00:01 +0000 (10:00 -0800)
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>
drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h

index 8b14437331c7a4ed4aff53a63de5a455063bf213..83720f61fdba5c5c594264f5e22561cbc0e9768e 100644 (file)
@@ -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,
index b3d6050730719077d22592855f5bdbeea3755b5a..d45d258e63f0b7dd974c3b8d4ebe1be2e4f226a3 100644 (file)
@@ -359,6 +359,7 @@ struct musb {
        struct otg_transceiver  xceiv;
 
        int nIrq;
+       unsigned                irq_wake:1;
 
        struct musb_hw_ep        endpoints[MUSB_C_NUM_EPS];
 #define control_ep             endpoints