pub trait Driver {
    type Data: ForeignOwnable + Send + Sync + DeviceRemoval = ();
    type IdInfo: 'static = ();

    const OF_DEVICE_ID_TABLE: Option<IdTable<'static, DeviceId, Self::IdInfo>> = None;

    fn probe(
        dev: &mut Device,
        id_info: Option<&Self::IdInfo>
    ) -> Result<Self::Data>; fn remove(_data: &Self::Data) -> Result { ... } }
Expand description

A platform driver.

Provided Associated Types

Data stored on device by driver.

Corresponds to the data set or retrieved via the kernel’s platform_{set,get}_drvdata() functions.

Require that Data implements ForeignOwnable. We guarantee to never move the underlying wrapped data structure. This allows

The type holding information about each device id supported by the driver.

Provided Associated Constants

The table of device ids supported by the driver.

Required Methods

Platform driver probe.

Called when a new platform device is added or discovered. Implementers should attempt to initialize the device here.

Provided Methods

Platform driver remove.

Called when a platform device is removed. Implementers should prepare the device for complete removal here.

Implementors

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.