Hello.

On 17-10-2012 21:06, Sebastian Andrzej Siewior wrote:

This patch factors out the three possible functions into three possible
bind functions which are passed as an argument to usb_add_config(). This
will ease the step by step converting of the individual functions to the
new function registration method.

Signed-off-by: Sebastian Andrzej Siewior <bige...@linutronix.de>
---
  drivers/usb/gadget/serial.c |   37 +++++++++++++++++++++++++++++--------
  1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 44752f5..8becf18 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -129,19 +129,33 @@ MODULE_PARM_DESC(n_ports, "number of ports to create, 
default=1");
/*-------------------------------------------------------------------------*/ -static int __init serial_bind_config(struct usb_configuration *c)
+static int __init serial_bind_acm_config(struct usb_configuration *c)
  {
        unsigned i;
        int status = 0;
- for (i = 0; i < n_ports && status == 0; i++) {
-               if (use_acm)
+       for (i = 0; i < n_ports && status == 0; i++)
                        status = acm_bind_config(c, i);

   Could you also change the indentation of the above line.

-               else if (use_obex)
+       return status;
+}
+
+static int __init serial_bind_obex_config(struct usb_configuration *c)
+{
+       unsigned i;
+       int status = 0;
+
+       for (i = 0; i < n_ports && status == 0; i++)
                        status = obex_bind_config(c, i);

   ... and this one.

-               else
+       return status;
+}
+
+static int __init serial_bind_gser_config(struct usb_configuration *c)
+{
+       unsigned i;
+       int status = 0;
+
+       for (i = 0; i < n_ports && status == 0; i++)
                        status = gser_bind_config(c, i);

   .... and this one too. They now need one level less.

WBR, Sergei

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

Reply via email to