Commit 52563c66 authored by Danilo Krummrich's avatar Danilo Krummrich
Browse files

rust: driver-core: use "kernel vertical" style for imports

Convert all imports to use "kernel vertical" style.

With this, subsequent patches neither introduce unrelated changes nor
leave an inconsistent import pattern.

While at it, drop unnecessary imports covered by prelude::*.

Link: https://docs.kernel.org/rust/coding-guidelines.html#imports


Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20260105142123.95030-3-dakr@kernel.org


Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent da74aee2
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -5,12 +5,20 @@
//! C header: [`include/linux/device.h`](srctree/include/linux/device.h)

use crate::{
    bindings, fmt,
    bindings,
    fmt,
    prelude::*,
    sync::aref::ARef,
    types::{ForeignOwnable, Opaque},
    types::{
        ForeignOwnable,
        Opaque, //
    }, //
};
use core::{
    any::TypeId,
    marker::PhantomData,
    ptr, //
};
use core::{any::TypeId, marker::PhantomData, ptr};

use crate::str::CStrExt as _;

+19 −6
Original line number Diff line number Diff line
@@ -8,13 +8,26 @@
use crate::{
    alloc::Flags,
    bindings,
    device::{Bound, Device},
    error::{to_result, Error, Result},
    ffi::c_void,
    device::{
        Bound,
        Device, //
    },
    error::to_result,
    prelude::*,
    revocable::{Revocable, RevocableGuard},
    sync::{aref::ARef, rcu, Completion},
    types::{ForeignOwnable, Opaque, ScopeGuard},
    revocable::{
        Revocable,
        RevocableGuard, //
    },
    sync::{
        aref::ARef,
        rcu,
        Completion, //
    },
    types::{
        ForeignOwnable,
        Opaque,
        ScopeGuard, //
    },
};

use pin_init::Wrapper;
+8 −4
Original line number Diff line number Diff line
@@ -90,10 +90,14 @@
//! [`pci::Driver`]: kernel::pci::Driver
//! [`platform::Driver`]: kernel::platform::Driver

use crate::error::{Error, Result};
use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule};
use core::pin::Pin;
use pin_init::{pin_data, pinned_drop, PinInit};
use crate::{
    acpi,
    device,
    of,
    prelude::*,
    types::Opaque,
    ThisModule, //
};

/// The [`RegistrationOps`] trait serves as generic interface for subsystems (e.g., PCI, Platform,
/// Amba, etc.) to provide the corresponding subsystem specific implementation to register /