/// Registers a character device with a static device identifier `dev_t`.
Registers a character device with a static device identifier `dev_t`.
Registers a character device with a static device identifier ` dev_t ` .
pub fn register_chrdev<D>(&mut self, device: D) -> Result<(), Errno>
    where
        D: FsNodeOps + WithStaticDeviceId + 'static,
    {
        match self.char_devices.entry(D::ID) {
            Entry::Vacant(e) => {
                e.insert(Box::new(device));
                Ok(())
            }
            Entry::Occupied(_) => {
                log::error!("dev type {:?} is already registered", D::ID);
                error!(EINVAL)
            }
        }
    }
pub fn register_chrdev < D > ( & mut self , device : D ) -> Result < ( ) , Errno > where D : FsNodeOps + WithStaticDeviceId + ' static , { match self . char_devices . entry ( D :: ID ) { Entry :: Vacant ( e ) => { e . insert ( Box :: new ( device ) ) ; Ok ( ( ) ) } Entry :: Occupied ( _ ) => { log :: error ! ( " " D ID ) ; error ! ( EINVAL ) } } }
Registers a character device with a static device identifier `dev_t`.
Registers a character device with a static device identifier ` dev_t ` .
&mut self
device
D