drivers/mtd/hyperbus/hyperbus-core.c
Source file repositories/reference/linux-study-clean/drivers/mtd/hyperbus/hyperbus-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mtd/hyperbus/hyperbus-core.c- Extension
.c- Size
- 3430 bytes
- Lines
- 141
- Domain
- Driver Families
- Bucket
- drivers/mtd
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/kernel.hlinux/module.hlinux/mtd/hyperbus.hlinux/mtd/map.hlinux/mtd/mtd.hlinux/of.hlinux/types.h
Detected Declarations
function hyperbus_read16function hyperbus_write16function hyperbus_copy_fromfunction hyperbus_copy_tofunction hyperbus_register_devicefunction hyperbus_unregister_deviceexport hyperbus_register_deviceexport hyperbus_unregister_device
Annotated Snippet
if (ops->calibrate && !ctlr->calibrated) {
ret = ops->calibrate(hbdev);
if (!ret) {
dev_err(dev, "Calibration failed\n");
return -ENODEV;
}
ctlr->calibrated = true;
}
}
hbdev->mtd = do_map_probe("cfi_probe", map);
if (!hbdev->mtd) {
dev_err(dev, "probing of hyperbus device failed\n");
return -ENODEV;
}
hbdev->mtd->dev.parent = dev;
mtd_set_of_node(hbdev->mtd, np);
ret = mtd_device_register(hbdev->mtd, NULL, 0);
if (ret) {
dev_err(dev, "failed to register mtd device\n");
map_destroy(hbdev->mtd);
return ret;
}
return 0;
}
EXPORT_SYMBOL_GPL(hyperbus_register_device);
void hyperbus_unregister_device(struct hyperbus_device *hbdev)
{
if (hbdev && hbdev->mtd) {
WARN_ON(mtd_device_unregister(hbdev->mtd));
map_destroy(hbdev->mtd);
}
}
EXPORT_SYMBOL_GPL(hyperbus_unregister_device);
MODULE_DESCRIPTION("HyperBus Framework");
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Vignesh Raghavendra <vigneshr@ti.com>");
Annotation
- Immediate include surface: `linux/err.h`, `linux/kernel.h`, `linux/module.h`, `linux/mtd/hyperbus.h`, `linux/mtd/map.h`, `linux/mtd/mtd.h`, `linux/of.h`, `linux/types.h`.
- Detected declarations: `function hyperbus_read16`, `function hyperbus_write16`, `function hyperbus_copy_from`, `function hyperbus_copy_to`, `function hyperbus_register_device`, `function hyperbus_unregister_device`, `export hyperbus_register_device`, `export hyperbus_unregister_device`.
- Atlas domain: Driver Families / drivers/mtd.
- Implementation status: integration 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.