Skip to content

Commit

Permalink
[sq] Print board name only when available
Browse files Browse the repository at this point in the history
  • Loading branch information
berkus committed Feb 12, 2022
1 parent 92b7859 commit 9050389
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions nucleus/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,10 @@ pub fn kmain(dtb: u32) -> ! {
let device_tree =
DeviceTree::new(device_tree, block).expect("Couldn't initialize indexed DeviceTree");

let model = device_tree
.get_prop_by_path("/model")
.unwrap()
.str()
.expect("Model must be a string");
println!("Booting on {}", model);
let board = device_tree.get_prop_by_path("/model").unwrap().str();
if board.is_ok() {
println!("Running on {}", board.unwrap());
}

// To init memory allocation we need to parse memory regions from dtb and add the regions to
// available memory regions list. Then initial BootRegionAllocator will get memory from these
Expand Down Expand Up @@ -233,11 +231,6 @@ pub fn kmain(dtb: u32) -> ! {

// let address_cells = device_tree.try_struct_u32_value("/#address-cells");
// let size_cells = device_tree.try_struct_u32_value("/#size-cells");
// let board = device_tree.try_struct_str_value("/model");

// if board.is_ok() {
// println!("Running on {}", board.unwrap());
// }

// println!(
// "Memory DTB info: address-cells {:?}, size-cells {:?}",
Expand Down

0 comments on commit 9050389

Please sign in to comment.