pci: Add error propagation to PCI BAR reprogramming

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-10-28 18:15:08 -07:00
committed by Samuel Ortiz
parent 3e819ac797
commit d6c68e4738
5 changed files with 56 additions and 22 deletions
+8 -4
View File
@@ -197,13 +197,15 @@ impl PciConfigIo {
// Reprogram the BAR if needed
if let Some(params) = bar_reprog_params {
pci_bus.device_reloc.upgrade().unwrap().move_bar(
if let Err(e) = pci_bus.device_reloc.upgrade().unwrap().move_bar(
params.old_base,
params.new_base,
params.len,
device.deref_mut(),
params.region_type,
);
) {
error!("Failed moving device BAR: {}", e);
}
}
}
}
@@ -313,13 +315,15 @@ impl PciConfigMmio {
// Reprogram the BAR if needed
if let Some(params) = bar_reprog_params {
pci_bus.device_reloc.upgrade().unwrap().move_bar(
if let Err(e) = pci_bus.device_reloc.upgrade().unwrap().move_bar(
params.old_base,
params.new_base,
params.len,
device.deref_mut(),
params.region_type,
);
) {
error!("Failed moving device BAR: {}", e);
}
}
}
}