MCPcopy Create free account
hub / github.com/coreboot/coreboot / init_dev

Function init_dev

src/device/device.c:539–562  ·  view source on GitHub ↗

* Initialize a specific device. * * The parent should be initialized first to avoid having an ordering problem. * This is done by calling the parent's init() method before its children's * init() methods. * * @param dev The device to be initialized. */

Source from the content-addressed store, hash-verified

537 * @param dev The device to be initialized.
538 */
539static void init_dev(struct device *dev)
540{
541 if (!dev->enabled)
542 return;
543
544 if (!dev->initialized && dev->ops && dev->ops->init) {
545 struct stopwatch sw;
546 long init_time;
547
548 if (dev->path.type == DEVICE_PATH_I2C) {
549 printk(BIOS_DEBUG, "smbus: %s->", dev_path(dev->upstream->dev));
550 }
551
552 printk(BIOS_DEBUG, "%s init\n", dev_path(dev));
553
554 stopwatch_init(&sw);
555 dev->initialized = 1;
556 dev->ops->init(dev);
557
558 init_time = stopwatch_duration_msecs(&sw);
559 printk(BIOS_DEBUG, "%s init finished in %ld msecs\n", dev_path(dev),
560 init_time);
561 }
562}
563
564static void init_link(struct bus *link)
565{

Callers 2

init_linkFunction · 0.85
dev_initializeFunction · 0.85

Calls 5

dev_pathFunction · 0.85
stopwatch_initFunction · 0.85
stopwatch_duration_msecsFunction · 0.85
printkFunction · 0.50
initMethod · 0.45

Tested by

no test coverage detected