Re: [PATCH v2] staging/ccg: Allow to overwrite composite's setup function

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

 



On 08/20/2012 01:47 PM, Michal Nazarewicz wrote:
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 598df69..790fc4d 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1598,9 +1598,18 @@ static const struct usb_gadget_driver composite_driver_template = {

  	.bind		= composite_bind,
  	.unbind		= composite_unbind,
-
+#ifdef USB_COMPOSITE_INCLUDED_BY_CCG
+	/*
+	 * This is to keep the Android code in staging working. The current
+	 * Kconfig dependencies don't allow any other gadgets besides the
+	 * Android one so it is not even a limitation.
+	 */
+	.setup		= ccg_setup,
+	.disconnect	= ccg_disconnect,
+#else
  	.setup		= composite_setup,
  	.disconnect	= composite_disconnect,
+#endif

Would it make sense to instead of doing that, wrap composite_setup() and
composite_disconnect() inside ifdef and make ccg.c define those two
functions?

I hoped you suggest to move ccg's dependencies into staging.
Why would want to move the ifdef into composite? ccg calls both
functions so it would give two ifdefs instead one central and I think
it would get more ugly.
Besidesm ccg should not do anything in there. The optional callback has
no users and the state update belongs into udc-core.

Sebastian
--
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