pub trait DriverOps {
    type RegType: Default;

    unsafe fn register(
        reg: *mut Self::RegType,
        name: &'static CStr,
        module: &'static ThisModule
    ) -> Result; unsafe fn unregister(reg: *mut Self::RegType); }
Expand description

A subsystem (e.g., PCI, Platform, Amba, etc.) that allows drivers to be written for it.

Required Associated Types

The type that holds information about the registration. This is typically a struct defined by the C portion of the kernel.

Required Methods

Registers a driver.


reg must point to valid, initialised, and writable memory. It may be modified by this function to hold registration state.

On success, reg must remain pinned and valid until the matching call to DriverOps::unregister.

Unregisters a driver previously registered with DriverOps::register.


reg must point to valid writable memory, initialised by a previous successful call to DriverOps::register.