/* If the ACPI node already has a physical device attached, skip it. */ if (adev->physical_node_count) return 0;
dev = amba_device_alloc(dev_name(&adev->dev), 0, 0); if (!dev) {
dev_err(&adev->dev, "%s(): amba_device_alloc() failed\n",
__func__); return -ENOMEM;
}
INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_resources(adev, &resource_list, NULL, NULL); if (ret < 0) goto err_free;
list_for_each_entry(rentry, &resource_list, node) { switch (resource_type(rentry->res)) { case IORESOURCE_MEM: if (!address_found) {
dev->res = *rentry->res;
dev->res.name = dev_name(&dev->dev);
address_found = true;
} break; case IORESOURCE_IRQ: if (irq_no < AMBA_NR_IRQS)
dev->irq[irq_no++] = rentry->res->start; break; default:
dev_warn(&adev->dev, "Invalid resource\n"); break;
}
}
acpi_dev_free_resource_list(&resource_list);
/* * If the ACPI node has a parent and that parent has a physical device * attached to it, that physical device should be the parent of * the amba device we are about to create.
*/ if (parent)
dev->dev.parent = acpi_get_first_physical_node(parent);
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.