Skip to content

Commit eb396f6

Browse files
marcanhoshinolina
authored andcommitted
rust: Fix x86 build
Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent fc6dddd commit eb396f6

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

rust/helpers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,13 @@ const struct of_device_id *rust_helper_of_match_device(
424424
}
425425
EXPORT_SYMBOL_GPL(rust_helper_of_match_device);
426426

427+
#ifdef CONFIG_OF
427428
bool rust_helper_of_node_is_root(const struct device_node *np)
428429
{
429430
return of_node_is_root(np);
430431
}
431432
EXPORT_SYMBOL_GPL(rust_helper_of_node_is_root);
433+
#endif
432434

433435
struct device_node *rust_helper_of_parse_phandle(const struct device_node *np,
434436
const char *phandle_name,

rust/kernel/of.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ impl Node {
162162

163163
/// Returns `true` if the node is the root node.
164164
pub fn is_root(&self) -> bool {
165+
#[cfg(not(CONFIG_OF))]
166+
{
167+
false
168+
}
169+
#[cfg(CONFIG_OF)]
165170
unsafe { bindings::of_node_is_root(self.raw_node) }
166171
}
167172

0 commit comments

Comments
 (0)