]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
Correct g_ether module init & exit fn
authorJoe Korty <joe.korty@ccur.com>
Wed, 25 May 2016 11:55:45 +0000 (17:25 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Tue, 5 Jul 2016 08:50:47 +0000 (01:50 -0700)
commit5f257c6c4eb641a0b35e8009c3253872c016e742
tree2e1b1086e795d514beeb8b6c228a9e7bef9f7e37
parente8fa3fb8bacb7558dca9a48b647fb066467f449c
Correct g_ether module init & exit fn

Replace u_ether.c's use of __initcall and __exitcall
with direct invocations of its init and exit function
from ether.c's module_init and module_exit functions.

We have to do this as 1) __initcall cannot be used
from within a module, and 2) module_init cannot be
declared more than once inside any .c file, and
3) ether.c #includes u_ether.c.

Fortunately, ether.c unconditionally includes u_ether.c,
so we can unconditionally add the u_ether.c's init code
directly to ether.c's init function.

include/linux/init.h:298:27:
error: redefinition of '__inittest'
static inline initcall_t __inittest(void)

include/linux/init.h:291:30: note:
in expansion of macro 'module_init'

drivers/usb/gadget/u_ether.c:1216:1: note:
in expansion of macro 'device_initcall'
device_initcall(gether_exit);

include/linux/init.h:298:27: note:
previous definition of '__inittest' was here
static inline initcall_t __inittest(void)

include/linux/init.h:291:30: note:
in expansion of macro 'module_init'

drivers/usb/gadget/u_ether.c:1209:1: note:
in expansion of macro 'device_initcall'
device_initcall(gether_init);

drivers/usb/gadget/u_ether.c: In function '__inittest':
drivers/usb/gadget/u_ether.c:1216:17: warning:
return from
incompatible pointer type [-Wincompatible-pointer-types]
device_initcall(gether_exit);

include/linux/init.h:299:11:
note: in definition of macro 'module_init'
  { return initfn; }

Bug 200187768

Change-Id: I37262041ae79aa2c1672499f735517b53ae5fc45
Signed-off-by: Joe Korty <joe.korty@ccur.com>
Signed-off-by: Gaurav Singh <gaursingh@nvidia.com>
Reviewed-on: http://git-master/r/1163924
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/usb/gadget/ether.c
drivers/usb/gadget/u_ether.c