Skip to content

Commit baf590d

Browse files
committed
soc: apple: pmp: Remove tunables subnode
Prefix properties instead with "apple,tunable-" and add them to main pmp devie node. Requires m1n1 changes. Signed-off-by: Janne Grunau <[email protected]>
1 parent 7df0b86 commit baf590d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

drivers/soc/apple/pmp.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use kernel::{
2727
platform,
2828
prelude::*,
2929
soc::apple::rtkit,
30+
str::CString,
3031
sync::{
3132
Arc,
3233
Mutex, //
@@ -299,8 +300,8 @@ impl PmpData {
299300
.unwrap();
300301
name_vec.push(0, GFP_KERNEL).unwrap();
301302
let name_str = CStr::from_bytes_until_nul(&name_vec).unwrap();
303+
let name_str = CString::try_from_fmt(fmt!("apple,tunable-{name_str}"))?;
302304
let node = self.dev.fwnode().ok_or(EIO)?;
303-
let tunables = node.get_child_by_name(c"tunables").ok_or(EIO)?;
304305
if state.value_buf.is_none() {
305306
dev_err!(self.dev, "Value buf not set");
306307
return Err(EIO);
@@ -312,10 +313,10 @@ impl PmpData {
312313
dev_err!(self.dev, "Unable to find value buffer");
313314
return Err(EIO);
314315
};
315-
if tunables.property_present(name_str) {
316-
let len = tunables.property_count_elem::<u8>(name_str)?;
317-
let data = tunables
318-
.property_read_array_vec::<u8>(name_str, len)?
316+
if node.property_present(&name_str) {
317+
let len = node.property_count_elem::<u8>(&name_str)?;
318+
let data = node
319+
.property_read_array_vec::<u8>(&name_str, len)?
319320
.required_by(&self.dev)?;
320321
unsafe {
321322
slice::from_raw_parts_mut(val_buf.start_ptr_mut(), len).copy_from_slice(&data);

0 commit comments

Comments
 (0)