From: Sasha Levin Date: Fri, 23 May 2025 12:21:28 +0000 (-0400) Subject: Drop rust-faux-add-missing-parent-argument-to-registratio.patch X-Git-Tag: v6.12.31~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c35e359e798bc363733bd7bd3352f4fe44e4e84;p=thirdparty%2Fkernel%2Fstable-queue.git Drop rust-faux-add-missing-parent-argument-to-registratio.patch Signed-off-by: Sasha Levin --- diff --git a/queue-6.14/rust-faux-add-missing-parent-argument-to-registratio.patch b/queue-6.14/rust-faux-add-missing-parent-argument-to-registratio.patch deleted file mode 100644 index 72f3de3bf5..0000000000 --- a/queue-6.14/rust-faux-add-missing-parent-argument-to-registratio.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 9a37f90cdd12a3ba078d2becf1555cc16205f694 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 27 Feb 2025 14:35:06 -0500 -Subject: rust/faux: Add missing parent argument to Registration::new() - -From: Lyude Paul - -[ Upstream commit 95cb0cb546c2892b7a31ff2fce6573f201a214b8 ] - -A little late in the review of the faux device interface, we added the -ability to specify a parent device when creating new faux devices - but -this never got ported over to the rust bindings. So, let's add the missing -argument now so we don't have to convert other users later down the line. - -Signed-off-by: Lyude Paul -Cc: Greg Kroah-Hartman -Link: https://lore.kernel.org/r/20250227193522.198344-1-lyude@redhat.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - rust/kernel/faux.rs | 13 +++++++++++-- - samples/rust/rust_driver_faux.rs | 2 +- - 2 files changed, 12 insertions(+), 3 deletions(-) - -diff --git a/rust/kernel/faux.rs b/rust/kernel/faux.rs -index 5acc0c02d451f..68f53edf05d70 100644 ---- a/rust/kernel/faux.rs -+++ b/rust/kernel/faux.rs -@@ -24,11 +24,20 @@ - - impl Registration { - /// Create and register a new faux device with the given name. -- pub fn new(name: &CStr) -> Result { -+ pub fn new(name: &CStr, parent: Option<&device::Device>) -> Result { - // SAFETY: - // - `name` is copied by this function into its own storage - // - `faux_ops` is safe to leave NULL according to the C API -- let dev = unsafe { bindings::faux_device_create(name.as_char_ptr(), null_mut(), null()) }; -+ // - `parent` can be either NULL or a pointer to a `struct device`, and `faux_device_create` -+ // will take a reference to `parent` using `device_add` - ensuring that it remains valid -+ // for the lifetime of the faux device. -+ let dev = unsafe { -+ bindings::faux_device_create( -+ name.as_char_ptr(), -+ parent.map_or(null_mut(), |p| p.as_raw()), -+ null(), -+ ) -+ }; - - // The above function will return either a valid device, or NULL on failure - // INVARIANT: The device will remain registered until faux_device_destroy() is called, which -diff --git a/samples/rust/rust_driver_faux.rs b/samples/rust/rust_driver_faux.rs -index 048c6cb98b29a..58a3a94121bff 100644 ---- a/samples/rust/rust_driver_faux.rs -+++ b/samples/rust/rust_driver_faux.rs -@@ -20,7 +20,7 @@ impl Module for SampleModule { - fn init(_module: &'static ThisModule) -> Result { - pr_info!("Initialising Rust Faux Device Sample\n"); - -- let reg = faux::Registration::new(c_str!("rust-faux-sample-device"))?; -+ let reg = faux::Registration::new(c_str!("rust-faux-sample-device"), None)?; - - dev_info!(reg.as_ref(), "Hello from faux device!\n"); - --- -2.39.5 - diff --git a/queue-6.14/series b/queue-6.14/series index e8cb12df9c..3e09d8b505 100644 --- a/queue-6.14/series +++ b/queue-6.14/series @@ -338,7 +338,6 @@ drm-xe-pf-create-a-link-between-pf-and-vf-devices.patch net-mlx5-avoid-report-two-health-errors-on-same-synd.patch selftests-net-have-gro.sh-t-return-a-correct-exit-co.patch driver-core-faux-only-create-the-device-if-probe-suc.patch -rust-faux-add-missing-parent-argument-to-registratio.patch pinctrl-sophgo-avoid-to-modify-untouched-bit-when-se.patch drm-amdkfd-kfd-release_work-possible-circular-lockin.patch drm-xe-xe_gen_wa_oob-replace-program_invocation_shor.patch