File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,21 +500,41 @@ where
500500
501501/// Returns the root node of the OF device tree (if any).
502502pub fn root ( ) -> Option < Node > {
503+ #[ cfg( not( CONFIG_OF ) ) ]
504+ {
505+ None
506+ }
507+ #[ cfg( CONFIG_OF ) ]
503508 unsafe { Node :: get_from_raw ( bindings:: of_root) }
504509}
505510
506511/// Returns the /chosen node of the OF device tree (if any).
507512pub fn chosen ( ) -> Option < Node > {
513+ #[ cfg( not( CONFIG_OF ) ) ]
514+ {
515+ None
516+ }
517+ #[ cfg( CONFIG_OF ) ]
508518 unsafe { Node :: get_from_raw ( bindings:: of_chosen) }
509519}
510520
511521/// Returns the /aliases node of the OF device tree (if any).
512522pub fn aliases ( ) -> Option < Node > {
523+ #[ cfg( not( CONFIG_OF ) ) ]
524+ {
525+ None
526+ }
527+ #[ cfg( CONFIG_OF ) ]
513528 unsafe { Node :: get_from_raw ( bindings:: of_aliases) }
514529}
515530
516531/// Returns the system stdout node of the OF device tree (if any).
517532pub fn stdout ( ) -> Option < Node > {
533+ #[ cfg( not( CONFIG_OF ) ) ]
534+ {
535+ None
536+ }
537+ #[ cfg( CONFIG_OF ) ]
518538 unsafe { Node :: get_from_raw ( bindings:: of_stdout) }
519539}
520540
You can’t perform that action at this time.
0 commit comments