RE: [patch-v2.6.32+ 10/12] usb: musb: do not work if no gadget driver is loaded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felipe,

This patch gives the following compilation error when built for Host mode
since "gadget_driver" is defined under CONFIG_USB_GADGET_MUSB_HDRC.

drivers/usb/musb/musb_core.c: In function 'musb_interrupt':
drivers/usb/musb/musb_core.c:1511: error: 'struct musb' has no member named
'gadget_driver'
make[2]: *** [drivers/usb/musb/musb_core.o] Error 1
make[1]: *** [drivers/usb/musb] Error 2
make: *** [drivers] Error 2

Regards,
Maulik

-----Original Message-----
From: linux-usb-owner@xxxxxxxxxxxxxxx
[mailto:linux-usb-owner@xxxxxxxxxxxxxxx] On Behalf Of Felipe Balbi
Sent: Tuesday, December 15, 2009 5:00 PM
To: Greg Kroah-Hartman
Cc: Linux USB Mailing List; David Brownell; Anand Gadiyar; Ajay Kumar Gupta;
Arnaud Mandy; Heikki Krogerus; Atal Shargorodsky; Yauheni Kaliuta; Felipe
Balbi; David Brownell
Subject: [patch-v2.6.32+ 10/12] usb: musb: do not work if no gadget driver
is loaded

On OTG and gadget-only configurations, we need a gadget driver
in order to work properly, so avoid changing operation modes
when there's no gadget driver loaded.

Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxx>
Cc: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
Acked-by: Anand Gadiyar <gadiyar@xxxxxx>
---
 drivers/usb/musb/musb_core.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index ec7eb5f..3740ca9 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1497,6 +1497,12 @@ irqreturn_t musb_interrupt(struct musb *musb)
 		(devctl & MUSB_DEVCTL_HM) ? "host" : "peripheral",
 		musb->int_usb, musb->int_tx, musb->int_rx);
 
+	if (is_otg_enabled(musb) || is_peripheral_enabled(musb))
+		if (!musb->gadget_driver) {
+			DBG(5, "No gadget driver loaded\n");
+			return IRQ_HANDLED;
+		}
+
 	/* the core can interrupt us for multiple reasons; docs have
 	 * a generic interrupt flowchart to follow
 	 */
-- 
1.6.6.rc0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux