Modules must be coded a bit differently than integrated function. If you used menuconfig and it offered to build as a module (“m”), then the code has module availability. Was your module configured with the “m” key in menuconfig? If so, then the issue is something different, e.g., the gadget has incomplete configuration.