src/devices/bin/driver_manager/coordinator.cc
// DriverAdded is called when a driver is added after the
// devcoordinator has started.  The driver is added to the new-drivers
// list and work is queued to process it.
DriverAdded is called when a driver is added after the
devcoordinator has started.  The driver is added to the new-drivers
list and work is queued to process it.
DriverAdded is called when a driver is added after the devcoordinator has started . The driver is added to the new - drivers list and work is queued to process it .
void Coordinator::DriverAdded(Driver* drv, const char* version) {
  auto driver = ValidateDriver(std::unique_ptr<Driver>(drv));
  if (!driver) {
    return;
  }
  async::PostTask(dispatcher_, [this, drv = std::move(driver)]() mutable {
    Driver* borrow_ref = drv.get();
    drivers_.push_back(std::move(drv));
    zx_status_t status = BindDriver(borrow_ref);
    if (status != ZX_OK && status != ZX_ERR_UNAVAILABLE) {
      LOGF(ERROR, "Failed to bind driver '%s': %s", borrow_ref->name.data(),
           zx_status_get_string(status));
    }
  });
}
void Coordinator :: DriverAdded ( Driver * drv , const char * version ) { auto driver = ValidateDriver ( std :: unique_ptr < Driver > ( drv ) ) ; if ( ! driver ) { return ; } async :: PostTask ( dispatcher_ , [ this , drv = std :: move ( driver ) ] ( ) mutable { Driver * borrow_ref = drv . get ( ) ; drivers_ . push_back ( std :: move ( drv ) ) ; zx_status_t status = BindDriver ( borrow_ref ) ; if ( status != ZX_OK && status != ZX_ERR_UNAVAILABLE ) { LOGF ( ERROR , " " , borrow_ref -> name . data ( ) , zx_status_get_string ( status ) ) ; } } ) ; }
DriverAdded is called when a driver is added after the
devcoordinator has started.
DriverAdded is called when a driver is added after the devcoordinator has started .