pub trait Driver {
type Data: PointerWrapper + 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
type Data: PointerWrapper + Send + Sync + DeviceRemoval = ()
type Data: PointerWrapper + Send + Sync + DeviceRemoval = ()
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 PointerWrapper
. We guarantee to
never move the underlying wrapped data structure. This allows