ret = kstrtoint(buf, 10, &reset); if (ret < 0) return ret; if ((reset == 1) || (reset == '1')) { wd->stopped = false; wd_trig(); } return count; } static struct kobj_attribute wd_inhib_attr = __ATTR_RO(inhib); static struct kobj_attribute wd_clock_attr = __ATTR_RO(clock); static struct kobj_attribute wd_remaining_time_attr = __ATTR_RO(remaining_time); static struct kobj_attribute wd_trig_attr = __ATTR_WO(trig); static struct attribute *wd_attrs[] = { &wd_inhib_attr.attr, &wd_clock_attr.attr, &wd_remaining_time_attr.attr, &wd_trig_attr.attr, NULL, }; static struct attribute_group wd_attr_group = { .name = NULL, .attrs = wd_attrs, }; static int __init wd_init(void)
{ struct msg_group_t *group = spk_find_msg_group(attr->attr.name); if (WARN_ON(!group)) return -EINVAL; return message_store_helper(buf, count, group); } /* * Declare the attributes. */ static struct kobj_attribute keymap_attribute = __ATTR_RW(keymap); static struct kobj_attribute silent_attribute = __ATTR_WO(silent); static struct kobj_attribute synth_attribute = __ATTR_RW(synth); static struct kobj_attribute synth_direct_attribute = __ATTR_WO(synth_direct); static struct kobj_attribute version_attribute = __ATTR_RO(version); static struct kobj_attribute delimiters_attribute = __ATTR(delimiters, 0644, punc_show, punc_store); static struct kobj_attribute ex_num_attribute = __ATTR(ex_num, 0644, punc_show, punc_store); static struct kobj_attribute punc_all_attribute = __ATTR(punc_all, 0644, punc_show, punc_store); static struct kobj_attribute punc_most_attribute = __ATTR(punc_most, 0644, punc_show, punc_store);
patch = container_of(kobj, struct klp_patch, kobj); if (patch != klp_transition_patch) { mutex_unlock(&klp_mutex); return -EINVAL; } klp_force_transition(); mutex_unlock(&klp_mutex); return count; } static struct kobj_attribute enabled_kobj_attr = __ATTR_RW(enabled); static struct kobj_attribute transition_kobj_attr = __ATTR_RO(transition); static struct kobj_attribute signal_kobj_attr = __ATTR_WO(signal); static struct kobj_attribute force_kobj_attr = __ATTR_WO(force); static struct attribute *klp_patch_attrs[] = { &enabled_kobj_attr.attr, &transition_kobj_attr.attr, &signal_kobj_attr.attr, &force_kobj_attr.attr, NULL }; static void klp_kobj_release_patch(struct kobject *kobj) { struct klp_patch *patch; patch = container_of(kobj, struct klp_patch, kobj); complete(&patch->finish);