pub fn build(&self) -> DeviceResult<Vec<Device>> {
        let mut intc_map = BTreeMap::new();
        let mut dev_list = Vec::new();

        self.walk(
            &self.dt.root,
            InheritProps::default(),
            &mut |node, comp, props| {
                if let Ok(dev) = self.parse_device(node, comp, props) {
                    if node.has_prop("interrupt-controller") {
                        if let Some(phandle) = dev.phandle {
                            // create the phandle-device mapping
                            intc_map.insert(phandle, dev_list.len());
                        }
                    }
                    dev_list.push(dev);
                }
            },
        );

        for dev in &dev_list {
            register_interrupt(dev, &dev_list, &intc_map).ok();
        }

        Ok(dev_list.into_iter().map(|d| d.dev).collect())
    }
/// Parse the device tree from root, and returns an array of [`Device`] it found.
Parse the device tree from root, and returns an array of [`Device`] it found.
Parse the device tree from root and returns an array of [ ` Device ` ] it found .
pub fn build(&self) -> DeviceResult<Vec<Device>> {
        let mut intc_map = BTreeMap::new();
        let mut dev_list = Vec::new();
        self.walk(
            &self.dt.root,
            InheritProps::default(),
            &mut |node, comp, props| {
                if let Ok(dev) = self.parse_device(node, comp, props) {
                    if node.has_prop("interrupt-controller") {
                        if let Some(phandle) = dev.phandle {
                            // create the phandle-device mapping
                            intc_map.insert(phandle, dev_list.len());
                        }
                    }
                    dev_list.push(dev);
                }
            },
        );
        for dev in &dev_list {
            register_interrupt(dev, &dev_list, &intc_map).ok();
        }
        Ok(dev_list.into_iter().map(|d| d.dev).collect())
    }
pub fn build ( & self ) -> DeviceResult < Vec < Device > > { let mut intc_map = BTreeMap :: new ( ) ; let mut dev_list = Vec :: new ( ) ; self . walk ( & self . dt . root , InheritProps :: default ( ) , & mut | node , comp , props | { if let Ok ( dev ) = self . parse_device ( node , comp , props ) { if node . has_prop ( " " ) { if let Some ( phandle ) = dev . phandle { // create the phandle-device mapping intc_map . insert ( phandle , dev_list . len ( ) ) ; } } dev_list . push ( dev ) ; } } , ) ; for dev in & dev_list { register_interrupt ( dev , & dev_list , & intc_map ) . ok ( ) ; } Ok ( dev_list . into_iter ( ) . map ( | d | d . dev ) . collect ( ) ) }
Parse the device tree from root, and returns an array of [`Device`] it found.
Parse the device tree from root and returns an array of [ ` Device ` ] it found .
&self
&self