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>