pub unsafe trait RawDevice {
fn raw_device(&self) -> *mut device;
fn name(&self) -> &CStr { ... }
fn clk_get(&self, id: Option<&CStr>) -> Result<Clk> { ... }
fn pr_emerg(&self, args: Arguments<'_>) { ... }
fn pr_alert(&self, args: Arguments<'_>) { ... }
fn pr_crit(&self, args: Arguments<'_>) { ... }
fn pr_err(&self, args: Arguments<'_>) { ... }
fn pr_warn(&self, args: Arguments<'_>) { ... }
fn pr_notice(&self, args: Arguments<'_>) { ... }
fn pr_info(&self, args: Arguments<'_>) { ... }
fn pr_dbg(&self, args: Arguments<'_>) { ... }
unsafe fn printk(&self, klevel: &[u8], msg: Arguments<'_>) { ... }
}
Expand description
A raw device.
Safety
Implementers must ensure that the *mut device
returned by RawDevice::raw_device
is
related to self
, that is, actions on it will affect self
. For example, if one calls
get_device
, then the refcount on the device represented by self
will be incremented.
Additionally, implementers must ensure that the device is never renamed. Commit a5462516aa99
(“driver-core: document restrictions on device_rename()”) has details on why device_rename
should not be used.
Required Methods
sourcefn raw_device(&self) -> *mut device
fn raw_device(&self) -> *mut device
Returns the raw struct device
related to self
.
Provided Methods
sourcefn clk_get(&self, id: Option<&CStr>) -> Result<Clk>
fn clk_get(&self, id: Option<&CStr>) -> Result<Clk>
Lookups a clock producer consumed by this device.
Returns a managed reference to the clock producer.
sourcefn pr_emerg(&self, args: Arguments<'_>)
fn pr_emerg(&self, args: Arguments<'_>)
Prints an emergency-level message (level 0) prefixed with device information.
More details are available from dev_emerg
.
sourcefn pr_alert(&self, args: Arguments<'_>)
fn pr_alert(&self, args: Arguments<'_>)
Prints an alert-level message (level 1) prefixed with device information.
More details are available from dev_alert
.
sourcefn pr_crit(&self, args: Arguments<'_>)
fn pr_crit(&self, args: Arguments<'_>)
Prints a critical-level message (level 2) prefixed with device information.
More details are available from dev_crit
.
sourcefn pr_err(&self, args: Arguments<'_>)
fn pr_err(&self, args: Arguments<'_>)
Prints an error-level message (level 3) prefixed with device information.
More details are available from dev_err
.
sourcefn pr_warn(&self, args: Arguments<'_>)
fn pr_warn(&self, args: Arguments<'_>)
Prints a warning-level message (level 4) prefixed with device information.
More details are available from dev_warn
.
sourcefn pr_notice(&self, args: Arguments<'_>)
fn pr_notice(&self, args: Arguments<'_>)
Prints a notice-level message (level 5) prefixed with device information.
More details are available from dev_notice
.
sourcefn pr_info(&self, args: Arguments<'_>)
fn pr_info(&self, args: Arguments<'_>)
Prints an info-level message (level 6) prefixed with device information.
More details are available from dev_info
.