You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: device_tree.rs
    path of file: ./repos/rCore/kernel/src/drivers
    
    the code of the file until where you have to start completion: use super::bus::virtio_mmio::virtio_probe;
use super::irq::IntcDriver;
use super::serial::uart16550;
use super::CMDLINE;
use crate::memory::phys_to_virt;
use alloc::{collections::BTreeMap, string::String, sync::Arc};
use core::slice;
use device_tree::{DeviceTree, Node};
use spin::RwLock;

const DEVICE_TREE_MAGIC: u32 = 0xd00dfeed;

lazy_static! {
    /// Compatible lookup
    pub static ref DEVICE_TREE_REGISTRY: RwLock<BTreeMap<&'static str, fn(&Node)>> =
        RwLock::new(BTreeMap::new());
    /// Interrupt controller lookup
 
    
fn walk_dt_node(dt: &Node, intc_only: bool) {
    if let Ok(compatible) = dt.prop_str("compatible") {
        if dt.has_prop("interrupt-controller") == intc_only {
            let registry = DEVICE_TREE_REGISTRY.read();
            if let Some(f) = registry.get(compatible) {
                f(dt);
            }
        }
    }
    if let Ok(bootargs) = dt.prop_str("bootargs") {
        if bootargs.len() > 0 {
            info!("Kernel cmdline: {}", bootargs);
            *CMDLINE.write() = String::from(bootargs);
        }
    }
    for child in dt.children.iter() {
        walk_dt_node(child, intc_only);
    }
}