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 2626#include <linux/pid_namespace.h>
2727#include <linux/platform_device.h>
2828#include <linux/poll.h>
29+ #include <linux/property.h>
2930#include <linux/refcount.h>
3031#include <linux/sched.h>
3132#include <linux/security.h>
Original file line number Diff line number Diff line change 66
77use crate :: {
88 bindings,
9+ str:: CString ,
910 types:: { ARef , Opaque } ,
1011} ;
1112use core:: { fmt, ptr} ;
@@ -180,6 +181,12 @@ impl Device {
180181 )
181182 } ;
182183 }
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+ }
183190}
184191
185192// SAFETY: Instances of `Device` are always reference-counted.
You can’t perform that action at this time.
0 commit comments