Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c48a5155 authored by Felipe Balbi's avatar Felipe Balbi Committed by Greg Kroah-Hartman
Browse files

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: default avatarFelipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b6a49b84
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -1840,7 +1840,7 @@ static void musb_free(struct musb *musb)
	musb_gadget_cleanup(musb);
	musb_gadget_cleanup(musb);
#endif
#endif


	if (musb->nIrq >= 0) {
	if (musb->nIrq >= 0 && musb->irq_wake) {
		disable_irq_wake(musb->nIrq);
		disable_irq_wake(musb->nIrq);
		free_irq(musb->nIrq, musb);
		free_irq(musb->nIrq, musb);
	}
	}
@@ -1993,8 +1993,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
	}
	}
	musb->nIrq = nIrq;
	musb->nIrq = nIrq;
/* FIXME this handles wakeup irqs wrong */
/* 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);
		device_init_wakeup(dev, 1);
	} else {
		musb->irq_wake = 0;
	}


	pr_info("%s: USB %s mode controller at %p using %s, IRQ %d\n",
	pr_info("%s: USB %s mode controller at %p using %s, IRQ %d\n",
			musb_driver_name,
			musb_driver_name,
+1 −0
Original line number Original line Diff line number Diff line
@@ -359,6 +359,7 @@ struct musb {
	struct otg_transceiver	xceiv;
	struct otg_transceiver	xceiv;


	int nIrq;
	int nIrq;
	unsigned		irq_wake:1;


	struct musb_hw_ep	 endpoints[MUSB_C_NUM_EPS];
	struct musb_hw_ep	 endpoints[MUSB_C_NUM_EPS];
#define control_ep		endpoints
#define control_ep		endpoints