Lines Matching +full:rc +full:- +full:map +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0+
6 * through the sysfs file system. The ESRT provides a read-only catalog of
98 return attr->show(entry, buf); in esre_attr_show()
110 efi_guid_to_str(&entry->esre.esre1->fw_class, str); in fw_class_show()
114 return str - buf; in fw_class_show()
119 #define esre_attr_decl(name, size, fmt) \ argument
120 static ssize_t name##_show(struct esre_entry *entry, char *buf) \
123 le##size##_to_cpu(entry->esre.esre1->name)); \
126 static struct esre_attribute esre_##name = __ATTR_RO_MODE(name, 0400)
151 list_del(&entry->list); in esre_release()
171 return -ENOMEM; in esre_create_sysfs_entry()
173 entry->kobj.kset = esrt_kset; in esre_create_sysfs_entry()
175 if (esrt->fw_resource_version == 1) { in esre_create_sysfs_entry()
176 int rc = 0; in esre_create_sysfs_entry() local
178 entry->esre.esre1 = esre; in esre_create_sysfs_entry()
179 rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL, in esre_create_sysfs_entry()
181 if (rc) { in esre_create_sysfs_entry()
182 kobject_put(&entry->kobj); in esre_create_sysfs_entry()
183 return rc; in esre_create_sysfs_entry()
187 list_add_tail(&entry->list, &entry_list); in esre_create_sysfs_entry()
192 #define esrt_attr_decl(name, size, fmt) \ argument
193 static ssize_t name##_show(struct kobject *kobj, \
196 return sprintf(buf, fmt "\n", le##size##_to_cpu(esrt->name)); \
199 static struct kobj_attribute esrt_##name = __ATTR_RO_MODE(name, 0400)
226 return attr->mode; in esrt_attr_is_visible()
243 int rc; in efi_esrt_init() local
249 pr_debug("esrt-init: loading.\n"); in efi_esrt_init()
253 rc = efi_mem_desc_lookup(efi.esrt, &md); in efi_esrt_init()
254 if (rc < 0 || in efi_esrt_init()
260 pr_warn("ESRT header is not in the memory map.\n"); in efi_esrt_init()
264 max = efi_mem_desc_end(&md) - efi.esrt; in efi_esrt_init()
268 pr_err("ESRT header doesn't fit on single memory map entry. (size: %zu max: %zu)\n", in efi_esrt_init()
290 if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) { in efi_esrt_init()
291 pr_err("ESRT memory map entry can only hold the header. (max: %zu size: %zu)\n", in efi_esrt_init()
292 max - size, entry_size); in efi_esrt_init()
315 pr_err("ESRT does not fit on single memory map entry (size: %zu max: %zu)\n", in efi_esrt_init()
330 pr_debug("esrt-init: loaded.\n"); in efi_esrt_init()
335 struct efi_system_resource_entry_v1 *v1_entries = (void *)esrt->entries; in register_entries()
336 int i, rc; in register_entries() local
341 for (i = 0; i < le32_to_cpu(esrt->fw_resource_count); i++) { in register_entries()
343 if (esrt->fw_resource_version == 1) { in register_entries()
347 esrt->fw_resource_version); in register_entries()
348 return -EINVAL; in register_entries()
351 rc = esre_create_sysfs_entry(esre, i); in register_entries()
352 if (rc < 0) { in register_entries()
354 rc); in register_entries()
355 return rc; in register_entries()
366 kobject_put(&entry->kobj); in cleanup_entry_list()
374 pr_debug("esrt-sysfs: loading.\n"); in esrt_sysfs_init()
376 return -ENOSYS; in esrt_sysfs_init()
382 return -ENOMEM; in esrt_sysfs_init()
388 error = -ENOMEM; in esrt_sysfs_init()
402 error = -ENOMEM; in esrt_sysfs_init()
410 pr_debug("esrt-sysfs: loaded.\n"); in esrt_sysfs_init()