diff --git a/crates/power-daemon/src/profile.rs b/crates/power-daemon/src/profile.rs index c599259..c5a90ac 100644 --- a/crates/power-daemon/src/profile.rs +++ b/crates/power-daemon/src/profile.rs @@ -617,7 +617,7 @@ impl ASPMSettings { pub struct PCISettings { pub enable_power_management: Option, // whitelist or blacklist device to exlude/include. - // Should be the name of the device under /sys/bus/pci/devices excluding the beggining 0000: + // Should be the name of the device under /sys/bus/pci/devices pub whiteblacklist: Option, } @@ -638,17 +638,9 @@ impl PCISettings { let entry = entry.expect("Could not read sysfs entry"); let path = entry.path(); - let device_name = path - .file_name() - .unwrap() - .to_str() - .unwrap() - .strip_prefix("0000:") - .unwrap(); - let enable_pm = WhiteBlackList::should_enable_item( &self.whiteblacklist, - device_name, + path.file_name().unwrap().to_str().unwrap(), self.enable_power_management.unwrap(), ); diff --git a/crates/power-daemon/src/systeminfo.rs b/crates/power-daemon/src/systeminfo.rs index f051991..20f5e4c 100644 --- a/crates/power-daemon/src/systeminfo.rs +++ b/crates/power-daemon/src/systeminfo.rs @@ -392,13 +392,7 @@ impl PCIInfo { )) .0; - let pci_address = device - .file_name() - .into_string() - .unwrap() - .strip_prefix("0000:") - .unwrap() - .to_string(); + let pci_address = device.file_name().into_string().unwrap(); pci_devices.push(PCIDeviceInfo { display_name,