From dc395c2831b59a90b4605ef38e6c6ef83cf8cc4f Mon Sep 17 00:00:00 2001 From: Danilo Krummrich Date: Tue, 26 May 2026 00:58:33 +0200 Subject: [PATCH] gpu: nova: separate driver type from driver data Split NovaDriver into a unit struct for trait implementations and a separate Nova struct for the private driver data. Reviewed-by: Eliot Courtney Reviewed-by: Alexandre Courbot Tested-by: Alexandre Courbot Link: https://patch.msgid.link/20260525225838.276108-6-dakr@kernel.org Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nova/driver.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nova/driver.rs b/drivers/gpu/drm/nova/driver.rs index e4765bc5b3ec..4289df7de01c 100644 --- a/drivers/gpu/drm/nova/driver.rs +++ b/drivers/gpu/drm/nova/driver.rs @@ -15,9 +15,11 @@ use crate::file::File; use crate::gem::NovaObject; -pub(crate) struct NovaDriver { +pub(crate) struct NovaDriver; + +pub(crate) struct Nova { #[expect(unused)] - drm: ARef>, + drm: ARef>, } /// Convienence type alias for the DRM device type for this driver @@ -51,19 +53,19 @@ pub(crate) struct NovaData { impl auxiliary::Driver for NovaDriver { type IdInfo = (); - type Data<'bound> = Self; + type Data<'bound> = Nova; const ID_TABLE: auxiliary::IdTable = &AUX_TABLE; fn probe<'bound>( adev: &'bound auxiliary::Device>, _info: &'bound Self::IdInfo, - ) -> impl PinInit + 'bound { + ) -> impl PinInit, Error> + 'bound { let data = try_pin_init!(NovaData { adev: adev.into() }); let drm = drm::Device::::new(adev.as_ref(), data)?; drm::Registration::new_foreign_owned(&drm, adev.as_ref(), 0)?; - Ok(Self { drm }) + Ok(Nova { drm }) } }