Re: [RFC/PATCH v2 1/3] usb: gadget: introduce start() and stop()

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

 



On Wed, 15 Sep 2010 11:43:55 +0200, Felipe Balbi <balbi@xxxxxx> wrote:
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
@@ -641,6 +643,44 @@ static inline int usb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA)
 }
/**
+ * usb_gadget_start - tells usb device controller to start up
+ * @gadget: The device we want to get started
+ *
+ * This call is issued by the UDC Class driver when it's about
+ * to register a gadget driver to the device controller, before
+ * calling gadget driver's bind() method.
+ *
+ * It allows the controller to be powered off until extrictly
+ * necessary to have it powered on.

I don't understand one thing.  Isn't bind() and unbind() enough for that?

+ *
+ * Returns zero on success, else negative errno.
+ */
+static inline int usb_gadget_start(struct usb_gadget *gadget)
+{
+	if (!gadget->ops->start)
+		return -EOPNOTSUPP;

Wouldn't it be better to return 0 here?

+	return gadget->ops->start(gadget);
+}

--
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
--
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