pub unsafe trait RegistrationOps: DriverLayout {
    // Required methods
    unsafe fn register(
        reg: &Opaque<Self::DriverType>,
        name: &'static CStr,
        module: &'static ThisModule
    ) -> Result;
    unsafe fn unregister(reg: &Opaque<Self::DriverType>);
}
Expand description

The RegistrationOps trait serves as generic interface for subsystems (e.g., PCI, Platform, Amba, etc.) to provide the corresponding subsystem specific implementation to register / unregister a driver of the particular type (DriverType).

For instance, the PCI subsystem would set DriverType to bindings::pci_driver and call bindings::__pci_register_driver from RegistrationOps::register and bindings::pci_unregister_driver from RegistrationOps::unregister.

§Safety

A call to RegistrationOps::unregister for a given instance of DriverType is only valid if a preceding call to RegistrationOps::register has been successful.

Required Methods§

source

unsafe fn register( reg: &Opaque<Self::DriverType>, name: &'static CStr, module: &'static ThisModule ) -> Result

Registers a driver.

§Safety

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

source

unsafe fn unregister(reg: &Opaque<Self::DriverType>)

Unregisters a driver previously registered with RegistrationOps::register.

§Safety

Must only be called after a preceding successful call to RegistrationOps::register for the same reg.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Driver + 'static> RegistrationOps for kernel::auxiliary::Adapter<T>

source§

impl<T: Driver + 'static> RegistrationOps for kernel::i2c::Adapter<T>

source§

impl<T: Driver + 'static> RegistrationOps for kernel::pci::Adapter<T>

source§

impl<T: Driver + 'static> RegistrationOps for kernel::platform::Adapter<T>

source§

impl<T: Driver + 'static> RegistrationOps for kernel::usb::Adapter<T>