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.

Dependency Surface

Detected Declarations

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

Implementation Notes