From: Danilo Krummrich Date: Mon, 25 May 2026 22:58:33 +0000 (+0200) Subject: gpu: nova: separate driver type from driver data X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=dc395c2831b59a90b4605ef38e6c6ef83cf8cc4f;p=thirdparty%2Flinux.git 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 --- diff --git a/drivers/gpu/drm/nova/driver.rs b/drivers/gpu/drm/nova/driver.rs index e4765bc5b3eca..4289df7de01cd 100644 --- a/drivers/gpu/drm/nova/driver.rs +++ b/drivers/gpu/drm/nova/driver.rs @@ -15,9 +15,11 @@ use kernel::{ 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 @@ kernel::auxiliary_device_table!( 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 }) } }