/* Initialises stuff and adds the entries in the map_entries list to sysfs. Important is that firmware_map_add() and firmware_map_add_early() must be called before late_initcall. That's just because that function is called as late_initcall() function, which means that if you call firmware_map_add() or firmware_map_add_early() afterwards, the entries are not added to sysfs.  */
static int __init memmap_init(void)
/* Initialises stuff and adds the entries in the map_entries list to sysfs. Important is that firmware_map_add() and firmware_map_add_early() must be called before late_initcall. That's just because that function is called as late_initcall() function, which means that if you call firmware_map_add() or firmware_map_add_early() afterwards, the entries are not added to sysfs.  */
static int __init memmap_init(void)
{
	int i = 0;
	struct firmware_map_entry *entry;
	struct kset *memmap_kset;
	memmap_kset = kset_create_and_add("memmap", NULL, firmware_kobj);
	if (WARN_ON(!memmap_kset))
		return -ENOMEM;
	list_for_each_entry(entry, &map_entries, list) {
		entry->kobj.kset = memmap_kset;
		if (kobject_add(&entry->kobj, NULL, "%d", i++))
			kobject_put(&entry->kobj);
	}
	return 0;
}