]> Pileus Git - ~andy/linux/commitdiff
Merge tag 'usb-for-v3.10-part2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Apr 2013 16:14:09 +0000 (09:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Apr 2013 16:14:09 +0000 (09:14 -0700)
Felipe writes:

usb: urgent fixes for v3.10 merge window

Here are some late urgent fixes for v3.10 merge window.

All of these errors were introduced by recent commits
which are in linux-next.

f_obex, multi and cdc2 gadget drivers have learned to
return a proper error code when something goes wrong.

usb_bind_phy() was mistakenly placed into .init.text
section which caused Section mismatch warnings and undefined
reference compile errors.

f_source_sink had a copy-paste error which is now corrected.

g_zero got a memory leak plugged.

Two defconfigs got fixed to enable the newly introduced
CONFIG_USB_PHY.

arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/mxs_defconfig
drivers/usb/gadget/cdc2.c
drivers/usb/gadget/f_obex.c
drivers/usb/gadget/f_sourcesink.c
drivers/usb/gadget/multi.c
drivers/usb/gadget/zero.c
drivers/usb/phy/phy.c

index e36b01025321112439ef6b53b585ec8073b0cb73..088d6c11a0fa1cb896cf9e2c04351d9382b98b17 100644 (file)
@@ -188,6 +188,7 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MXC=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
+CONFIG_USB_PHY=y
 CONFIG_USB_MXS_PHY=y
 CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
index 6a99e30f81d2ac992da503ba5338571c2d2731ba..87924d671115928509d5bd360f1ea92a8c50acc6 100644 (file)
@@ -120,6 +120,7 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_PHY=y
 CONFIG_USB_MXS_PHY=y
 CONFIG_MMC=y
 CONFIG_MMC_MXS=y
index c6ee6f1558c390454e13a0a2008e2a0836f407e2..2c52551827692c5bd119bf78513e32e3f0fd7116 100644 (file)
@@ -129,8 +129,10 @@ static int __init cdc_do_config(struct usb_configuration *c)
                return PTR_ERR(fi_serial);
 
        f_acm = usb_get_function(fi_serial);
-       if (IS_ERR(f_acm))
+       if (IS_ERR(f_acm)) {
+               status = PTR_ERR(f_acm);
                goto err_func_acm;
+       }
 
        status = usb_add_function(c, f_acm);
        if (status)
index 29a348a2a294fafe37676d260257f90c6332c7b1..8aa2be5329bcff2a3619c4aa0044c944afa5566f 100644 (file)
@@ -348,6 +348,7 @@ static int obex_bind(struct usb_configuration *c, struct usb_function *f)
 
        /* allocate instance-specific endpoints */
 
+       status = -ENODEV;
        ep = usb_ep_autoconfig(cdev->gadget, &obex_fs_ep_in_desc);
        if (!ep)
                goto fail;
index 41adf3ef96c2b48234c962d0817a4811a0f6d4aa..a8895859a221ce7f54f385284d155aa869cbd438 100644 (file)
@@ -898,7 +898,7 @@ static struct usb_function *source_sink_alloc_func(
        return &ss->function;
 }
 
-static void acm_free_instance(struct usb_function_instance *fi)
+static void source_sink_free_instance(struct usb_function_instance *fi)
 {
        struct f_ss_opts *ss_opts;
 
@@ -913,7 +913,7 @@ static struct usb_function_instance *source_sink_alloc_inst(void)
        ss_opts = kzalloc(sizeof(*ss_opts), GFP_KERNEL);
        if (!ss_opts)
                return ERR_PTR(-ENOMEM);
-       ss_opts->func_inst.free_func_inst = acm_free_instance;
+       ss_opts->func_inst.free_func_inst = source_sink_free_instance;
        return &ss_opts->func_inst;
 }
 DECLARE_USB_FUNCTION(SourceSink, source_sink_alloc_inst,
index a74ebefc7682c7fe71ae4ec0153bdd7933c237b6..4a45e80c6e384f6adb0fa4cfe6a1efc909419625 100644 (file)
@@ -157,8 +157,10 @@ static __init int rndis_do_config(struct usb_configuration *c)
                return ret;
 
        f_acm_rndis = usb_get_function(fi_acm);
-       if (IS_ERR(f_acm_rndis))
+       if (IS_ERR(f_acm_rndis)) {
+               ret = PTR_ERR(f_acm_rndis);
                goto err_func_acm;
+       }
 
        ret = usb_add_function(c, f_acm_rndis);
        if (ret)
index 685fa681cb6542abcea1f3b3fb02218201019551..2cd6262e8b7149a23d8458e76e5ef6ef3b919f1c 100644 (file)
@@ -368,8 +368,10 @@ static int zero_unbind(struct usb_composite_dev *cdev)
        del_timer_sync(&autoresume_timer);
        if (!IS_ERR_OR_NULL(func_ss))
                usb_put_function(func_ss);
+       usb_put_function_instance(func_inst_ss);
        if (!IS_ERR_OR_NULL(func_lb))
                usb_put_function(func_lb);
+       usb_put_function_instance(func_inst_lb);
        return 0;
 }
 
index f52c006417ff222ee268488ea5b17917464252a3..a9984c700d2c428fd2e771a1d175c12009f94475 100644 (file)
@@ -413,7 +413,7 @@ EXPORT_SYMBOL_GPL(usb_remove_phy);
  *
  * To be used by platform specific initialization code.
  */
-int __init usb_bind_phy(const char *dev_name, u8 index,
+int usb_bind_phy(const char *dev_name, u8 index,
                                const char *phy_dev_name)
 {
        struct usb_phy_bind *phy_bind;