Skip to contentSkip to conversation

minimal fixes for drivers/usb/gadget/m66592-udc.c

PATCH David Brownell 2 participants 4 messages Jul 15, 2007 – Jul 16, 2007 USB

lore
Share & tools
lore
#0 lore raw

Let's not do that. The driver shouldn't have been merged before its review finished (or before the amd5536 udc driver) ... here's the current fixup patch, which has been verified as working. There are still a few open issues to resolve.

- Dave

========= CUT HERE
This patch incorporates some updates from the review of the Renesas m66592-udc driver. Updates include:

- Fix some locking bugs; and add a few sparse annotations
- Don't #define __iomem !
- Lots of whitespace fixes (most of the patch by volume)
- Some #include file trimmage
- Other checkpatch.pl and sparse updates
- Alphabetized and slightly-more-informative Kconfig
- Don't use the ID which was assigned to the amd5536udc driver.
- Remove pointless suspend/resume methods updating obsolete field.
- Some section fixups

More importantly for the moment, it gets the driver to build again; the original version included broken versions of since-removed methods.

---
 drivers/usb/gadget/Kconfig        |   36 +-
 drivers/usb/gadget/gadget_chips.h |    2 
 drivers/usb/gadget/m66592-udc.c   |  252 +++++++--------
 drivers/usb/gadget/m66592-udc.h   |  608 ++++++++++++++++++--------------------
 4 files changed, 436 insertions(+), 462 deletions(-)
drivers/usb/gadget/Kconfig +18 -18
@@ -156,6 +156,24 @@ config USB_PXA2XX_SMALL
 	default y if USB_ETH
 	default y if USB_G_SERIAL
 
+config USB_GADGET_M66592
+	boolean "Renesas M66592 USB Peripheral Controller"
+	select USB_GADGET_DUALSPEED
+	help
+	   M66592 is a discrete USB peripheral controller chip that
+	   supports both full and high speed USB 2.0 data transfers.
+	   It has seven configurable endpoints, and endpoint zero.
+
+	   Say "y" to link the driver statically, or "m" to build a
+	   dynamically linked module called "m66592_udc" and force all
+	   gadget drivers to also be dynamically linked.
+
+config USB_M66592
+	tristate
+	depends on USB_GADGET_M66592
+	default USB_GADGET
+	select USB_GADGET_SELECTED
+
 config USB_GADGET_GOKU
 	boolean "Toshiba TC86C001 'Goku-S'"
 	depends on PCI
@@ -261,24 +279,6 @@ config USB_AT91
 	depends on USB_GADGET_AT91
 	default USB_GADGET
 
-config USB_GADGET_M66592
-	boolean "M66592 driver"
-	select USB_GADGET_DUALSPEED
-	help
-	   M66592 is a USB 2.0 peripheral controller.
-
-	   It has seven configurable endpoints, and endpoint zero.
-
-	   Say "y" to link the driver statically, or "m" to build a
-	   dynamically linked module called "m66592_udc" and force all
-	   gadget drivers to also be dynamically linked.
-
-config USB_M66592
-	tristate
-	depends on USB_GADGET_M66592
-	default USB_GADGET
-	select USB_GADGET_SELECTED
-
 config USB_GADGET_DUMMY_HCD
 	boolean "Dummy HCD (DEVELOPMENT)"
 	depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL
drivers/usb/gadget/gadget_chips.h +1 -1
@@ -203,6 +203,6 @@ static inline int usb_gadget_controller_
 	else if (gadget_is_fsl_usb2(gadget))
 		return 0x19;
 	else if (gadget_is_m66592(gadget))
-		return 0x20;
+		return 0x21;
 	return -ENOENT;
 }
drivers/usb/gadget/m66592-udc.c +114 -138

630 lines not on this page · raw message

drivers/usb/gadget/m66592-udc.h +303 -305

725 lines not on this page · raw message

#1 lore raw

Re the leaks, in probe() request_irq() isn't cleaned up ... but it looked to me like the rest of the allocations did get cleaned up afer probe() errors. But remove() does indeed leak the memory you highlighted.

#2 lore raw
Quoted 4 lines · David Brownell

Re the leaks, in probe() request_irq() isn't cleaned up ... but it looked to me like the rest of the allocations did get cleaned up afer probe() errors. But remove() does indeed leak the memory you highlighted.

Why not make ep0_buf a 16bit field in that struct?

#3 lore raw
Quoted 7 lines · Al Viro
Quoted 4 lines · David Brownell

Re the leaks, in probe() request_irq() isn't cleaned up ... but it looked to me like the rest of the allocations did get cleaned up afer probe() errors. But remove() does indeed leak the memory you highlighted.

Why not make ep0_buf a 16bit field in that struct?

Ask the driver author. :)

That should work, given proper byteswapping. It's only used to transmit certain results.

- Dave