Lines Matching refs:entry
54 ssize_t (*show)(struct dmi_sysfs_entry *entry, char *buf);
69 ssize_t (*show)(struct dmi_sysfs_entry *entry,
101 struct dmi_sysfs_entry *entry = to_entry(kobj); in dmi_sysfs_attr_show() local
108 return attr->show(entry, buf); in dmi_sysfs_attr_show()
119 struct dmi_sysfs_entry *entry; member
130 struct dmi_sysfs_entry *entry = data->entry; in find_dmi_entry_helper() local
133 if (dh->type != entry->dh.type) in find_dmi_entry_helper()
149 data->ret = data->callback(entry, dh, data->private); in find_dmi_entry_helper()
159 static ssize_t find_dmi_entry(struct dmi_sysfs_entry *entry, in find_dmi_entry() argument
163 .entry = entry, in find_dmi_entry()
166 .instance_countdown = entry->instance, in find_dmi_entry()
203 static ssize_t dmi_entry_attr_show_helper(struct dmi_sysfs_entry *entry, in dmi_entry_attr_show_helper() argument
212 return attr->show(entry, dh, data->buf); in dmi_entry_attr_show_helper()
269 static ssize_t dmi_sysfs_sel_##_field(struct dmi_sysfs_entry *entry, \
361 static ssize_t dmi_sel_raw_read_io(struct dmi_sysfs_entry *entry, in dmi_sel_raw_read_io() argument
378 static ssize_t dmi_sel_raw_read_phys32(struct dmi_sysfs_entry *entry, in dmi_sel_raw_read_phys32() argument
399 static ssize_t dmi_sel_raw_read_helper(struct dmi_sysfs_entry *entry, in dmi_sel_raw_read_helper() argument
415 return dmi_sel_raw_read_io(entry, &sel, state->buf, in dmi_sel_raw_read_helper()
418 return dmi_sel_raw_read_phys32(entry, &sel, state->buf, in dmi_sel_raw_read_helper()
434 struct dmi_sysfs_entry *entry = to_entry(kobj->parent); in dmi_sel_raw_read() local
441 return find_dmi_entry(entry, dmi_sel_raw_read_helper, &state); in dmi_sel_raw_read()
449 static int dmi_system_event_log(struct dmi_sysfs_entry *entry) in dmi_system_event_log() argument
453 entry->child = kzalloc(sizeof(*entry->child), GFP_KERNEL); in dmi_system_event_log()
454 if (!entry->child) in dmi_system_event_log()
456 ret = kobject_init_and_add(entry->child, in dmi_system_event_log()
458 &entry->kobj, in dmi_system_event_log()
463 ret = sysfs_create_bin_file(entry->child, &dmi_sel_raw_attr); in dmi_system_event_log()
470 kobject_del(entry->child); in dmi_system_event_log()
472 kfree(entry->child); in dmi_system_event_log()
480 static ssize_t dmi_sysfs_entry_length(struct dmi_sysfs_entry *entry, char *buf) in dmi_sysfs_entry_length() argument
482 return sprintf(buf, "%d\n", entry->dh.length); in dmi_sysfs_entry_length()
485 static ssize_t dmi_sysfs_entry_handle(struct dmi_sysfs_entry *entry, char *buf) in dmi_sysfs_entry_handle() argument
487 return sprintf(buf, "%d\n", entry->dh.handle); in dmi_sysfs_entry_handle()
490 static ssize_t dmi_sysfs_entry_type(struct dmi_sysfs_entry *entry, char *buf) in dmi_sysfs_entry_type() argument
492 return sprintf(buf, "%d\n", entry->dh.type); in dmi_sysfs_entry_type()
495 static ssize_t dmi_sysfs_entry_instance(struct dmi_sysfs_entry *entry, in dmi_sysfs_entry_instance() argument
498 return sprintf(buf, "%d\n", entry->instance); in dmi_sysfs_entry_instance()
501 static ssize_t dmi_sysfs_entry_position(struct dmi_sysfs_entry *entry, in dmi_sysfs_entry_position() argument
504 return sprintf(buf, "%d\n", entry->position); in dmi_sysfs_entry_position()
507 static DMI_SYSFS_ATTR(entry, length);
508 static DMI_SYSFS_ATTR(entry, handle);
509 static DMI_SYSFS_ATTR(entry, type);
510 static DMI_SYSFS_ATTR(entry, instance);
511 static DMI_SYSFS_ATTR(entry, position);
522 static ssize_t dmi_entry_raw_read_helper(struct dmi_sysfs_entry *entry, in dmi_entry_raw_read_helper() argument
540 struct dmi_sysfs_entry *entry = to_entry(kobj); in dmi_entry_raw_read() local
547 return find_dmi_entry(entry, dmi_entry_raw_read_helper, &state); in dmi_entry_raw_read()
557 struct dmi_sysfs_entry *entry = to_entry(kobj); in dmi_sysfs_entry_release() local
560 list_del(&entry->list); in dmi_sysfs_entry_release()
562 kfree(entry); in dmi_sysfs_entry_release()
582 struct dmi_sysfs_entry *entry; in dmi_sysfs_register_handle() local
590 entry = kzalloc(sizeof(*entry), GFP_KERNEL); in dmi_sysfs_register_handle()
591 if (!entry) { in dmi_sysfs_register_handle()
597 memcpy(&entry->dh, dh, sizeof(*dh)); in dmi_sysfs_register_handle()
598 entry->instance = instance_counts[dh->type]++; in dmi_sysfs_register_handle()
599 entry->position = position_count++; in dmi_sysfs_register_handle()
601 entry->kobj.kset = dmi_kset; in dmi_sysfs_register_handle()
602 *ret = kobject_init_and_add(&entry->kobj, &dmi_sysfs_entry_ktype, NULL, in dmi_sysfs_register_handle()
603 "%d-%d", dh->type, entry->instance); in dmi_sysfs_register_handle()
606 kobject_put(&entry->kobj); in dmi_sysfs_register_handle()
612 list_add_tail(&entry->list, &entry_list); in dmi_sysfs_register_handle()
618 *ret = dmi_system_event_log(entry); in dmi_sysfs_register_handle()
628 *ret = sysfs_create_bin_file(&entry->kobj, &dmi_entry_raw_attr); in dmi_sysfs_register_handle()
634 kobject_put(entry->child); in dmi_sysfs_register_handle()
635 kobject_put(&entry->kobj); in dmi_sysfs_register_handle()
641 struct dmi_sysfs_entry *entry, *next; in cleanup_entry_list() local
644 list_for_each_entry_safe(entry, next, &entry_list, list) { in cleanup_entry_list()
645 kobject_put(entry->child); in cleanup_entry_list()
646 kobject_put(&entry->kobj); in cleanup_entry_list()