#include <linux/pid_namespace.h>
#include <linux/platform_device.h>
#include <linux/poll.h>
+#include <linux/property.h>
#include <linux/refcount.h>
#include <linux/sched.h>
#include <linux/security.h>
use crate::{
bindings,
+ str::CString,
types::{ARef, Opaque},
};
use core::{fmt, ptr};
)
};
}
+
+ /// Checks if property is present or not.
+ pub fn property_present(&self, name: &CString) -> bool {
+ // SAFETY: By the invariant of `CString`, `name` is null-terminated.
+ unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_ptr() as *const _) }
+ }
}
// SAFETY: Instances of `Device` are always reference-counted.