[PATCH v6 1/7] rust: clk: use 'kernel vertical style' for imports
Daniel Almeida
daniel.almeida at collabora.com
Tue Oct 13 10:07:40 PDT 2026
Convert all imports to use the new import style. This will make it easier
to land new changes in the future. Drop the `Result` import, which the
prelude already provides.
No change of functionality implied.
Link: https://docs.kernel.org/rust/coding-guidelines.html#imports
Reviewed-by: Alexandre Courbot <acourbot at nvidia.com>
Reviewed-by: Onur Özkan <work at onurozkan.dev>
Signed-off-by: Daniel Almeida <daniel.almeida at collabora.com>
---
rust/kernel/clk.rs | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/rust/kernel/clk.rs b/rust/kernel/clk.rs
index f04f5c4a03d6..c73fe7c57251 100644
--- a/rust/kernel/clk.rs
+++ b/rust/kernel/clk.rs
@@ -96,11 +96,17 @@ mod common_clk {
use super::Hertz;
use crate::{
device::Device,
- error::{from_err_ptr, to_result, Result},
- prelude::*,
+ error::{
+ from_err_ptr,
+ to_result, //
+ },
+ prelude::*, //
};
- use core::{ops::Deref, ptr};
+ use core::{
+ ops::Deref,
+ ptr, //
+ };
/// A reference-counted clock.
///
@@ -119,9 +125,11 @@ mod common_clk {
/// The following example demonstrates how to obtain and configure a clock for a device.
///
/// ```
- /// use kernel::clk::{Clk, Hertz};
+ /// use kernel::clk::{
+ /// Clk,
+ /// Hertz,
+ /// };
/// use kernel::device::Device;
- /// use kernel::error::Result;
///
/// fn configure_clk(dev: &Device) -> Result {
/// let clk = Clk::get(dev, Some(c"apb_clk"))?;
@@ -293,9 +301,11 @@ fn drop(&mut self) {
/// device. The code functions correctly whether or not the clock is available.
///
/// ```
- /// use kernel::clk::{OptionalClk, Hertz};
+ /// use kernel::clk::{
+ /// Hertz,
+ /// OptionalClk,
+ /// };
/// use kernel::device::Device;
- /// use kernel::error::Result;
///
/// fn configure_clk(dev: &Device) -> Result {
/// let clk = OptionalClk::get(dev, Some(c"apb_clk"))?;
--
2.56.0
More information about the linux-riscv
mailing list