Skip to content

Commit 36b2021

Browse files
committed
rust: of: Discourage us of "of" properties
Use FwNode based device properties instead. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent b5b6e2d commit 36b2021

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

rust/kernel/of.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,24 @@ impl Node {
101101
}
102102

103103
/// Returns the name of the node.
104-
pub fn name(&self) -> &CStr {
104+
pub(crate) fn name(&self) -> &CStr {
105105
// SAFETY: The lifetime of the `CStr` is the same as the lifetime of this `Node`.
106106
unsafe { CStr::from_char_ptr(self.node().name) }
107107
}
108108

109109
/// Returns the phandle for this node.
110-
pub fn phandle(&self) -> PHandle {
110+
pub(crate) fn phandle(&self) -> PHandle {
111111
self.node().phandle
112112
}
113113

114114
/// Returns the full name (with address) for this node.
115-
pub fn full_name(&self) -> &CStr {
115+
pub(crate) fn full_name(&self) -> &CStr {
116116
// SAFETY: The lifetime of the `CStr` is the same as the lifetime of this `Node`.
117117
unsafe { CStr::from_char_ptr(self.node().full_name) }
118118
}
119119

120120
/// Returns `true` if the node is the root node.
121-
pub fn is_root(&self) -> bool {
121+
pub(crate) fn is_root(&self) -> bool {
122122
#[cfg(not(CONFIG_OF))]
123123
{
124124
false
@@ -131,7 +131,7 @@ impl Node {
131131
}
132132

133133
/// Returns the parent node, if any.
134-
pub fn parent(&self) -> Option<Node> {
134+
pub(crate) fn parent(&self) -> Option<Node> {
135135
#[cfg(not(CONFIG_OF))]
136136
{
137137
None
@@ -162,7 +162,7 @@ impl Node {
162162

163163
/// Find a child by its name and return it, or None if not found.
164164
#[allow(unused_variables)]
165-
pub fn get_child_by_name(&self, name: &CStr) -> Option<Node> {
165+
pub(crate) fn get_child_by_name(&self, name: &CStr) -> Option<Node> {
166166
#[cfg(not(CONFIG_OF))]
167167
{
168168
None
@@ -182,7 +182,7 @@ impl Node {
182182
/// Returns `None` if there is no match, or `Some<NonZeroU32>` if there is, with the value
183183
/// representing as match score (higher values for more specific compatible matches).
184184
#[allow(unused_variables)]
185-
pub fn is_compatible(&self, compatible: &CStr) -> Option<NonZeroU32> {
185+
pub(crate) fn is_compatible(&self, compatible: &CStr) -> Option<NonZeroU32> {
186186
#[cfg(not(CONFIG_OF))]
187187
let ret = 0;
188188
#[cfg(CONFIG_OF)]
@@ -232,7 +232,7 @@ impl Node {
232232

233233
#[allow(unused_variables)]
234234
/// Look up a node property by name, returning a `Property` object if found.
235-
pub fn find_property(&self, propname: &CStr) -> Option<Property<'_>> {
235+
pub(crate) fn find_property(&self, propname: &CStr) -> Option<Property<'_>> {
236236
#[cfg(not(CONFIG_OF))]
237237
{
238238
None

0 commit comments

Comments
 (0)