All pastes #487185 Raw Edit

Mine

public c v1 · immutable
·published 2007-05-14 09:45 UTC
rendered paste body
/* Start the driver.  */efi_status_text2_start (efi_driver_binding_t *this, efi_handle_t controller,            efi_device_path_t *remaining){  efi_block_io_t *block_io = NULL;  efi_disk_io_t *disk_io = NULL;  efi_status_t err;  ext2_file_system_t *fs;  /* Kill warning. */  (void) remaining;  fs = efi_malloc (EFI_MEMORY_TYPE_BOOT_SERVICES_DATA,                   sizeof (ext2_file_system_t));  if (! fs)    {      err = EFI_OUT_OF_RESOURCES;      goto error;    }  efi_memset (fs, 0, sizeof (ext2_file_system_t));  /* Consume disk I/O protocol with BY_DRIVER.  */  err = efi_open_protocol (controller, &EFI_DISK_IO_GUID,                           (void **) &fs->disk_io,                           this->driver_binding_handle, controller,                           EFI_OPEN_PROTOCOL_BY_DRIVER);  if (err)    goto error;  /* Consume block I/O protocol by GET_PROTOCOL. */  err = efi_open_protocol (controller, &EFI_BLOCK_IO_GUID,                           (void **) &fs->block_io,                           this->driver_binding_handle, controller,                           EFI_OPEN_PROTOCOL_GET_PROTOCOL);  if (err)    goto error;  err = efi_fshelp_install_protocol_interface (controller, &fs->fshelp,                                               &fshelp_ops);  if (err)    goto error;  return EFI_SUCCESS; error:  if (fs)    {      if (fs->block_io)        efi_close_protocol (controller, &EFI_BLOCK_IO_GUID,                            this->driver_binding_handle, controller);      if (fs->disk_io)        efi_close_protocol (controller, &EFI_DISK_IO_GUID,                            this->driver_binding_handle, controller);      efi_free_pool (fs);    }  return err;}