Re: [PATCH V11 13/15] rust: cpufreq: Extend abstractions for driver registration

From: Viresh Kumar
Date: Thu Apr 24 2025 - 06:55:17 EST


On 24-04-25, 10:03, Danilo Krummrich wrote:
> Yes, driver-core-next won't be rebased.

Thanks. Here is the diff after rebase:

diff --git a/rust/kernel/cpufreq.rs b/rust/kernel/cpufreq.rs
index 8628f0bada02..55a219148eed 100644
--- a/rust/kernel/cpufreq.rs
+++ b/rust/kernel/cpufreq.rs
@@ -11,7 +11,7 @@
use crate::{
clk::{Clk, Hertz},
cpumask,
- device::Device,
+ device::{Bound, Device},
devres::Devres,
error::{code::*, from_err_ptr, from_result, to_result, Result, VTABLE_DEFAULT_ERROR},
ffi::{c_char, c_ulong},
@@ -835,7 +835,7 @@ fn register_em(_policy: &mut Policy) {
/// use kernel::{
/// cpu, cpufreq,
/// c_str,
-/// device::Device,
+/// device::{Bound, Device},
/// macros::vtable,
/// sync::Arc,
/// };
@@ -879,7 +879,7 @@ fn register_em(_policy: &mut Policy) {
/// }
/// }
///
-/// fn foo_probe(dev: &Device) {
+/// fn foo_probe(dev: &Device<Bound>) {
/// cpufreq::Registration::<FooDriver>::new_foreign_owned(dev).unwrap();
/// }
/// ```
@@ -1031,7 +1031,7 @@ pub fn new() -> Result<Self> {
///
/// Instead the [`Registration`] is owned by [`Devres`] and will be revoked / dropped, once the
/// device is detached.
- pub fn new_foreign_owned(dev: &Device) -> Result<()> {
+ pub fn new_foreign_owned(dev: &Device<Bound>) -> Result<()> {
Devres::new_foreign_owned(dev, Self::new()?, GFP_KERNEL)
}
}

--
viresh