File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 26
26
#include <linux/pid_namespace.h>
27
27
#include <linux/platform_device.h>
28
28
#include <linux/poll.h>
29
+ #include <linux/property.h>
29
30
#include <linux/refcount.h>
30
31
#include <linux/sched.h>
31
32
#include <linux/security.h>
Original file line number Diff line number Diff line change 6
6
7
7
use crate :: {
8
8
bindings,
9
+ str:: CString ,
9
10
types:: { ARef , Opaque } ,
10
11
} ;
11
12
use core:: { fmt, ptr} ;
@@ -180,6 +181,12 @@ impl Device {
180
181
)
181
182
} ;
182
183
}
184
+
185
+ /// Checks if property is present or not.
186
+ pub fn property_present ( & self , name : & CString ) -> bool {
187
+ // SAFETY: By the invariant of `CString`, `name` is null-terminated.
188
+ unsafe { bindings:: device_property_present ( self . as_raw ( ) . cast_const ( ) , name. as_ptr ( ) as * const _ ) }
189
+ }
183
190
}
184
191
185
192
// SAFETY: Instances of `Device` are always reference-counted.
You can’t perform that action at this time.
0 commit comments