mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
ac97: Fix setting the pci config
When switching to PciBarConfiguration, the set_* functions were changed to return self. The self for register index 1 was not being used. TEST=boot a VM and check that there isn't a pci bus creation error. Change-Id: I8d5162c70fcec1159a6283e26e744d0c3c76b804 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1497737 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
This commit is contained in:
parent
a632f4b170
commit
5e1b46cbd8
1 changed files with 4 additions and 4 deletions
|
@ -141,24 +141,24 @@ impl PciDevice for Ac97Dev {
|
|||
let mixer_regs_addr = resources
|
||||
.allocate_mmio_addresses(MIXER_REGS_SIZE)
|
||||
.ok_or(pci_device::Error::IoAllocationFailed(MIXER_REGS_SIZE))?;
|
||||
let config: PciBarConfiguration = PciBarConfiguration::default()
|
||||
let mixer_config = PciBarConfiguration::default()
|
||||
.set_register_index(0)
|
||||
.set_address(mixer_regs_addr)
|
||||
.set_size(MIXER_REGS_SIZE);
|
||||
self.config_regs
|
||||
.add_pci_bar(&config)
|
||||
.add_pci_bar(&mixer_config)
|
||||
.ok_or_else(|| pci_device::Error::IoRegistrationFailed(mixer_regs_addr))?;
|
||||
ranges.push((mixer_regs_addr, MIXER_REGS_SIZE));
|
||||
|
||||
let master_regs_addr = resources
|
||||
.allocate_mmio_addresses(MASTER_REGS_SIZE)
|
||||
.ok_or_else(|| pci_device::Error::IoAllocationFailed(MASTER_REGS_SIZE))?;
|
||||
config
|
||||
let master_config = PciBarConfiguration::default()
|
||||
.set_register_index(1)
|
||||
.set_address(master_regs_addr)
|
||||
.set_size(MASTER_REGS_SIZE);
|
||||
self.config_regs
|
||||
.add_pci_bar(&config)
|
||||
.add_pci_bar(&master_config)
|
||||
.ok_or_else(|| pci_device::Error::IoRegistrationFailed(master_regs_addr))?;
|
||||
ranges.push((master_regs_addr, MASTER_REGS_SIZE));
|
||||
Ok(ranges)
|
||||
|
|
Loading…
Reference in a new issue