Why do we call the constructor function of a new device?   I can't see where
we ever set it.
Thanks,
Myles

>From device/device.c:

   memset(dev, 0, sizeof(*dev));
    dev->path = *path;
    dev->id = *devid;

    /* Initialize the back pointers in the link fields. */
    for (link = 0; link < MAX_LINKS; link++) {
        dev->link[link].dev = dev;
        dev->link[link].link = link;
    }

    /* By default devices are enabled. */
    dev->enabled = 1;

    /* Add the new device to the list of children of the bus. */
    dev->bus = parent;
    if (child) {
        child->sibling = dev;
    } else {
        parent->children = dev;
    }

    /* Append a new device to the global device list.
     * The list is used to find devices once everything is set up.
     */
    *last_dev_p = dev;
    last_dev_p = &dev->next;

    /* Give the device a name. */
    sprintf(dev->dtsname, "dynamic %s", dev_path(dev));

    /* Run the device specific constructor as last part of the chain
     * so it gets the chance to overwrite the "inherited" values above
     */

    constructor(dev);
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to