All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: dakr@kernel.org, aliceryhl@google.com, acourbot@nvidia.com,
	daniel.almeida@collabora.com, ojeda@kernel.org, boqun@kernel.org,
	gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
	a.hindborg@kernel.org, tmgross@umich.edu, tamird@kernel.org,
	work@onurozkan.dev
Cc: nova-gpu@lists.linux.dev, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: [PATCH 2/2] rust: drm: Remove unused flags argument from Registration::new()
Date: Tue, 29 Sep 2026 20:59:31 +0200	[thread overview]
Message-ID: <20260929190024.2248099-2-dakr@kernel.org> (raw)
In-Reply-To: <20260929190024.2248099-1-dakr@kernel.org>

The flags argument to drm_dev_register() is only passed to the
deprecated .load() callback. Rust DRM drivers always set this callback
to NULL, so the argument has no effect.

Remove the argument from drm::Registration::new(), pass zero to
drm_dev_register(), and update the Nova and Tyr callers.

Signed-off-by: Danilo Krummrich <dakr@kernel.org>
---
 drivers/gpu/drm/nova/driver.rs | 2 +-
 drivers/gpu/drm/tyr/driver.rs  | 1 -
 rust/kernel/drm/driver.rs      | 3 +--
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nova/driver.rs b/drivers/gpu/drm/nova/driver.rs
index 50537efe8d94..5fe98f646082 100644
--- a/drivers/gpu/drm/nova/driver.rs
+++ b/drivers/gpu/drm/nova/driver.rs
@@ -79,7 +79,7 @@ fn probe<'bound>(
 
                 // SAFETY: `reg` is stored in `Self::Data` and dropped when the driver is unbound;
                 // it is never forgotten.
-                unsafe { drm::Registration::new(adev.as_ref(), drm, reg_data, 0) }
+                unsafe { drm::Registration::new(adev.as_ref(), drm, reg_data) }
             },
             drm: reg.device().into(),
         })
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index 6e1008290b5f..c2b99d67369f 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -183,7 +183,6 @@ fn probe<'bound>(
                         iomem,
                         gpu_info,
                     }),
-                    0,
                 )},
                 _: { dev_dbg!(pdev, "Tyr initialized correctly.") },
             }))
diff --git a/rust/kernel/drm/driver.rs b/rust/kernel/drm/driver.rs
index 13aa609350b1..f6db91e81e79 100644
--- a/rust/kernel/drm/driver.rs
+++ b/rust/kernel/drm/driver.rs
@@ -169,7 +169,6 @@ pub unsafe fn new<E>(
         dev: &'a device::Device<device::Bound>,
         drm: drm::UnregisteredDevice<T>,
         data: impl PinInit<T::RegistrationData<'a>, E>,
-        flags: usize,
     ) -> impl PinInit<Self, Error>
     where
         Error: From<E>,
@@ -196,7 +195,7 @@ pub unsafe fn new<E>(
                 unsafe { *drm.registration_data.get() = ptr };
 
                 // SAFETY: `drm` is a valid, initialized but not yet registered DRM device.
-                let ret = unsafe { bindings::drm_dev_register(drm.as_raw(), flags) };
+                let ret = unsafe { bindings::drm_dev_register(drm.as_raw(), 0) };
                 to_result(ret).inspect_err(|_| {
                     // SAFETY: `drm_dev_register()` synchronizes SRCU on failure, so no
                     // concurrent access to `registration_data` is possible at this point.
-- 
2.55.0


  reply	other threads:[~2026-09-29 19:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 18:59 [PATCH 1/2] rust: drm: Return impl PinInit from drm::Registration::new() Danilo Krummrich
2026-09-29 18:59 ` Danilo Krummrich [this message]
2026-10-10 15:03 ` Alice Ryhl
2026-10-10 21:27 ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260929190024.2248099-2-dakr@kernel.org \
    --to=dakr@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nova-gpu@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.