BPI-SINOVOIP / BPI-M3-bsp

Supports BananaPi BPI -M3 (Kernel3.4)
47 stars 45 forks source link

Cannot build the USB Mass Storage Gadget module #19

Open Tamerz opened 7 years ago

Tamerz commented 7 years ago

I am able to build the kernel if I do not make any changes to the configuration. However, as soon as I change:

Device Drivers -> USB Support -> USB Gadget Support ->USB Gadget Drivers from built in (*) to a module (M) and then select the Mass Storage Gadget and build the kernel, I get:

WARNING: modpost: Found 23 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
drivers/built-in.o: In function  `sunxi_udc_irq':
clk-ac100.c:(.text+0x19c8e8): undefined reference to `vfs_read_flag'
clk-ac100.c:(.text+0x19c8ec): undefined reference to `vfs_write_flag'
clk-ac100.c:(.text+0x19c8f0): undefined reference to `vfs_amount'
clk-ac100.c:(.text+0x19c8f4): undefined reference to `vfs_file_offset'
drivers/built-in.o: In function `udc_init':
clk-ac100.c:(.text+0x8974): undefined reference to `vfs_read_flag'
clk-ac100.c:(.text+0x8978): undefined reference to `vfs_write_flag'
make[1]: *** [.tmp_vmlinux1] Error 1
make[1]: Leaving directory `/root/bananapi/BPI-M3-bsp/linux-sunxi'
make: *** [kernel] Error 2
Gunzmo commented 7 years ago

It's an issue in KernelDir/drivers/usb/sunxi_usb/gadget/f_mass_storage.c:72-75 edit extern atomic_t vfs_read_flag; extern atomic_t vfs_write_flag; extern unsigned int vfs_amount; extern loff_t vfs_file_offset; to atomic_t vfs_read_flag; atomic_t vfs_write_flag; unsigned int vfs_amount; loff_t vfs_file_offset;

tested and it compiles