/* * The target device is embedded and RAM-constrained. We save RAM * by initializing in __init code that gets dropped late in boot. * For the same reason there is no module or unloading support.
*/ staticint __init n64cart_probe(struct platform_device *pdev)
{ struct queue_limits lim = {
.physical_block_size = 4096,
.logical_block_size = 4096,
}; struct gendisk *disk; int err = -ENOMEM;
if (!start || !size) {
pr_err("start or size not specified\n"); return -ENODEV;
}
if (size & 4095) {
pr_err("size must be a multiple of 4K\n"); return -ENODEV;
}
reg_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(reg_base)) return PTR_ERR(reg_base);
disk = blk_alloc_disk(&lim, NUMA_NO_NODE); if (IS_ERR(disk)) {
err = PTR_ERR(disk); goto out;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.