arch/x86/platform/geode/geode-common.c
Source file repositories/reference/linux-study-clean/arch/x86/platform/geode/geode-common.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/platform/geode/geode-common.c- Extension
.c- Size
- 4726 bytes
- Lines
- 191
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/gpio/machine.hlinux/gpio/property.hlinux/input.hlinux/leds.hlinux/platform_device.hlinux/slab.hgeode-common.h
Detected Declarations
function geode_create_restart_keyfunction geode_create_leds
Annotated Snippet
if (!node_name) {
err = -ENOMEM;
goto err_free_names;
}
gpio_refs[i] = SOFTWARE_NODE_REFERENCE(&geode_gpiochip_node,
leds[i].pin,
GPIO_ACTIVE_LOW);
props[i * 3 + 0] =
PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &gpio_refs[i], 1);
props[i * 3 + 1] =
PROPERTY_ENTRY_STRING("linux,default-trigger",
leds[i].default_on ?
"default-on" : "default-off");
/* props[i * 3 + 2] is an empty terminator */
swnodes[i] = SOFTWARE_NODE(node_name, &props[i * 3],
&geode_gpio_leds_node);
group[i + 1] = &swnodes[i];
}
err = software_node_register_node_group(group);
if (err) {
pr_err("failed to register LED software nodes: %d\n", err);
goto err_free_names;
}
led_info.fwnode = software_node_fwnode(&geode_gpio_leds_node);
led_dev = platform_device_register_full(&led_info);
err = PTR_ERR_OR_ZERO(led_dev);
if (err) {
pr_err("failed to create LED device: %d\n", err);
goto err_unregister_group;
}
return 0;
err_unregister_group:
software_node_unregister_node_group(group);
err_free_names:
while (--i >= 0)
kfree(swnodes[i].name);
kfree(gpio_refs);
err_free_props:
kfree(props);
err_free_swnodes:
kfree(swnodes);
return err;
}
Annotation
- Immediate include surface: `linux/err.h`, `linux/gpio/machine.h`, `linux/gpio/property.h`, `linux/input.h`, `linux/leds.h`, `linux/platform_device.h`, `linux/slab.h`, `geode-common.h`.
- Detected declarations: `function geode_create_restart_key`, `function geode_create_leds`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.