int iio_sw_trigger_type_configfs_register(struct iio_sw_trigger_type *tt) { config_group_init_type_name(&tt->group, tt->name, &iio_trigger_type_group_type); return configfs_register_group(&iio_triggers_group, &tt->group); }
/** * dtbocfg_module_init() */ static int __init dtbocfg_module_init(void) { int retval = 0; pr_info("%s\n", __func__); config_group_init(&dtbocfg_root_subsys.su_group); config_group_init_type_name(&dtbocfg_overlay_group, "overlays", &dtbocfg_overlays_type); retval = configfs_register_subsystem(&dtbocfg_root_subsys); if (retval != 0) { pr_err( "%s: couldn't register subsys\n", __func__); goto register_subsystem_failed; } retval = configfs_register_group(&dtbocfg_root_subsys.su_group, &dtbocfg_overlay_group); if (retval != 0) { pr_err( "%s: couldn't register group\n", __func__); goto register_group_failed; } pr_info("%s: OK\n", __func__); return 0; register_group_failed: configfs_unregister_subsystem(&dtbocfg_root_subsys); register_subsystem_failed: return retval; }
int iio_device_type_configfs_register(struct config_group *dummy, const char *name) { config_group_init_type_name(dummy, name, &iio_device_type_group_type); return configfs_register_group(&iio_devices_group, dummy); }