[PATCH v4 3/8] gpu: nova-core: split BAR acquisition in unbind()
From: Alexandre Courbot
Date: Mon Apr 27 2026 - 02:58:15 EST
We are going to use the BAR to perform other teardown tasks, so move its
acquisition into a dedicated code block with a more meaningful error
message.
Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
---
drivers/gpu/nova-core/gpu.rs | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 233a4bcec9fc..920783362251 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -319,10 +319,11 @@ pub(crate) fn new<'a>(
///
/// Note: This method must only be called from `Driver::unbind`.
pub(crate) fn unbind(&self, dev: &device::Device<device::Core>) {
- kernel::warn_on!(self
- .bar
- .access(dev)
- .inspect(|bar| self.sysmem_flush.unregister(bar))
- .is_err());
+ let Ok(bar) = self.bar.access(dev) else {
+ dev_err!(dev, "failed to acquire bar for driver unbinding\n");
+ return;
+ };
+
+ self.sysmem_flush.unregister(bar);
}
}
--
2.54.0