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

Returns the raw struct device related to self.

Provided Methods

Returns the name of the device.

Lookups a clock producer consumed by this device.

Returns a managed reference to the clock producer.

Prints an emergency-level message (level 0) prefixed with device information.

More details are available from dev_emerg.

Prints an alert-level message (level 1) prefixed with device information.

More details are available from dev_alert.

Prints a critical-level message (level 2) prefixed with device information.

More details are available from dev_crit.

Prints an error-level message (level 3) prefixed with device information.

More details are available from dev_err.

Prints a warning-level message (level 4) prefixed with device information.

More details are available from dev_warn.

Prints a notice-level message (level 5) prefixed with device information.

More details are available from dev_notice.

Prints an info-level message (level 6) prefixed with device information.

More details are available from dev_info.

Prints a debug-level message (level 7) prefixed with device information.

More details are available from dev_dbg.

Prints the provided message to the console.

Safety

Callers must ensure that klevel is null-terminated; in particular, one of the KERN_*constants, for example, KERN_CRIT, KERN_ALERT, etc.

Implementors

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