Lines Matching refs:entry

357 	ssize_t (*show)(struct fw_cfg_sysfs_entry *entry, char *buf);
372 static inline void fw_cfg_sysfs_cache_enlist(struct fw_cfg_sysfs_entry *entry)
375 list_add_tail(&entry->list, &fw_cfg_entry_cache);
379 static inline void fw_cfg_sysfs_cache_delist(struct fw_cfg_sysfs_entry *entry)
382 list_del(&entry->list);
388 struct fw_cfg_sysfs_entry *entry, *next;
390 list_for_each_entry_safe(entry, next, &fw_cfg_entry_cache, list) {
391 fw_cfg_sysfs_cache_delist(entry);
392 kobject_put(&entry->kobj);
396 /* default_attrs: per-entry attributes and show methods */
430 /* sysfs_ops: find fw_cfg_[entry, attribute] and call appropriate show method */
434 struct fw_cfg_sysfs_entry *entry = to_entry(kobj);
437 return attr->show(entry, buf);
447 struct fw_cfg_sysfs_entry *entry = to_entry(kobj);
449 kfree(entry);
452 /* kobj_type: ties together all properties required to register an entry */
464 struct fw_cfg_sysfs_entry *entry = to_entry(kobj);
466 if (pos > entry->size)
469 if (count > entry->size - pos)
470 count = entry->size - pos;
472 return fw_cfg_read_blob(entry->select, buf, pos, count);
564 list_for_each_entry_safe(k, next, &kset->list, entry)
582 struct fw_cfg_sysfs_entry *entry;
593 /* allocate new entry */
594 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
595 if (!entry)
598 /* set file entry information */
599 entry->size = be32_to_cpu(f->size);
600 entry->select = be16_to_cpu(f->select);
601 strscpy(entry->name, f->name, FW_CFG_MAX_FILE_PATH);
603 /* register entry under "/sys/firmware/qemu_fw_cfg/by_key/" */
604 err = kobject_init_and_add(&entry->kobj, &fw_cfg_sysfs_entry_ktype,
605 fw_cfg_sel_ko, "%d", entry->select);
610 err = sysfs_create_bin_file(&entry->kobj, &fw_cfg_sysfs_attr_raw);
615 fw_cfg_build_symlink(fw_cfg_fname_kset, &entry->kobj, entry->name);
617 /* success, add entry to global cache */
618 fw_cfg_sysfs_cache_enlist(entry);
622 kobject_del(&entry->kobj);
624 kobject_put(&entry->kobj);
710 /* process fw_cfg file directory entry, registering each file */