]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
Fix __init section mismatch in usb gadget driver
authorJoe Korty <joe.korty@ccur.com>
Wed, 25 May 2016 09:08:19 +0000 (14:38 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 5 Jul 2016 13:04:13 +0000 (06:04 -0700)
gcc complains when __init variables or __init functions
are referenced from non-init code, as by the time the
non-init code is run, the __init variables and functions
it references might no longer exist.

Fix by removing the __init from the afunc_bind defition.
This allows it to be called from anywhere, anytime without
problem.

WARNING: drivers/usb/gadget/g_audio.o(.text+0x101c): Section
mismatch in reference from the function audio_bind_config()
to the function .init.text:afunc_bind()
The function audio_bind_config() references
the function __init afunc_bind().
This is often because audio_bind_config lacks a __init
annotation or the annotation of afunc_bind is wrong.

Bug 200187768

Change-Id: I3df30f66a100273b6b1d9b1a29a2ded022027690
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1163919
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
drivers/usb/gadget/f_uac2.c

index 6aa6462d53f165d88979bcecad7679d8156c7eeb..d21482efea8a0928c1589f9c5800bd65a5f79dae 100644 (file)
@@ -924,7 +924,7 @@ free_ep(struct uac2_rtd_params *prm, struct usb_ep *ep)
                        "%s:%d Error!\n", __func__, __LINE__);
 }
 
-static int __init
+static int
 afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
 {
        struct audio_dev *agdev = func_to_agdev(fn);