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