Make Bar1 an alias for a borrowed pci::Bar in order to match the Bar0 type alias.
Signed-off-by: Danilo Krummrich <[email protected]> --- drivers/gpu/nova-core/driver.rs | 4 ++-- drivers/gpu/nova-core/gpu.rs | 2 +- drivers/gpu/nova-core/mm/bar_user.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs index 0672a0707a71..9ce70703b2ce 100644 --- a/drivers/gpu/nova-core/driver.rs +++ b/drivers/gpu/nova-core/driver.rs @@ -32,7 +32,7 @@ pub(crate) struct NovaCore<'bound> { #[pin] pub(crate) gpu: Gpu<'bound>, bar: pci::Bar<'bound, BAR0_SIZE>, - bar1: Bar1<'bound>, + bar1: pci::Bar<'bound>, #[allow(clippy::type_complexity)] _reg: auxiliary::Registration<'bound, CovariantForLt!(())>, } @@ -43,7 +43,7 @@ pub(crate) struct NovaCore<'bound> { pub(crate) type Bar0<'a> = &'a pci::Bar<'a, BAR0_SIZE>; pub(crate) type NovaRegisters = kernel::io::Region<BAR0_SIZE>; -pub(crate) type Bar1<'a> = pci::Bar<'a>; +pub(crate) type Bar1<'a> = &'a pci::Bar<'a>; /// Returns the Linux PCI resource index that holds BAR1 for an NVIDIA GPU. /// diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index 8f30186f10ba..1ae287c9e776 100644 --- a/drivers/gpu/nova-core/gpu.rs +++ b/drivers/gpu/nova-core/gpu.rs @@ -353,7 +353,7 @@ impl<'gpu> Gpu<'gpu> { pub(crate) fn new<'a>( pdev: &'gpu pci::Device<device::Core<'a>>, bar: Bar0<'gpu>, - bar1: &'gpu Bar1<'gpu>, + bar1: Bar1<'gpu>, ) -> impl PinInit<Self, Error> + use<'gpu, 'a> { let dev = pdev.as_ref(); diff --git a/drivers/gpu/nova-core/mm/bar_user.rs b/drivers/gpu/nova-core/mm/bar_user.rs index 8f4a27c1fd14..86b5d302188e 100644 --- a/drivers/gpu/nova-core/mm/bar_user.rs +++ b/drivers/gpu/nova-core/mm/bar_user.rs @@ -41,7 +41,7 @@ pub(crate) struct BarUser<'gpu> { #[pin] vmm: Mutex<Vmm>, - bar1: &'gpu Bar1<'gpu>, + bar1: Bar1<'gpu>, } impl<'gpu> BarUser<'gpu> { @@ -50,7 +50,7 @@ pub(crate) fn new( pdb_addr: VramAddress, chipset: Chipset, va_size: u64, - bar1: &'gpu Bar1<'gpu>, + bar1: Bar1<'gpu>, ) -> Result<impl PinInit<Self> + 'gpu> { let vmm = Vmm::new(pdb_addr, chipset.mmu_version(), va_size)?; Ok(pin_init!(Self { -- 2.55.0
