int ftm_register(struct ftm_module *mod, ftm_entry_fn entry, void *priv)
{ if (mod == NULL || entry == NULL) return -EINVAL; if (mod->id < 0 || mod->id > ITEM_MAX_IDS - 1) return -EINVAL;mod->test_result = FTM_TEST_UNKNOWN;
mod->visible = true; mod->entry = entry; mod->priv = priv; ftm_mods[mod->id] = mod;return 0;
}typedef int (*ftm_entry_fn)(struct ftm_param *param, void *priv);
struct ftm_module {
int id; bool visible; void *priv; ftm_entry_fn entry; int test_result;};struct ftm_param {
const char *name; int test_type;};