power: Change range values from tuple to RangeInclusive

This commit is contained in:
Vicki Pfau 2025-03-20 17:34:57 -07:00
parent d5f4de72ca
commit 93a78041fb
2 changed files with 31 additions and 16 deletions

View file

@ -363,12 +363,18 @@ impl GpuPerformanceLevel1 {
#[zbus(property(emits_changed_signal = "const"))]
async fn manual_gpu_clock_min(&self) -> fdo::Result<u32> {
Ok(get_gpu_clocks_range().await.map_err(to_zbus_fdo_error)?.0)
Ok(*get_gpu_clocks_range()
.await
.map_err(to_zbus_fdo_error)?
.start())
}
#[zbus(property(emits_changed_signal = "const"))]
async fn manual_gpu_clock_max(&self) -> fdo::Result<u32> {
Ok(get_gpu_clocks_range().await.map_err(to_zbus_fdo_error)?.1)
Ok(*get_gpu_clocks_range()
.await
.map_err(to_zbus_fdo_error)?
.end())
}
}
@ -480,12 +486,12 @@ impl TdpLimit1 {
#[zbus(property(emits_changed_signal = "const"))]
async fn tdp_limit_min(&self) -> u32 {
get_tdp_limit_range().await.map(|(min, _)| min).unwrap_or(0)
get_tdp_limit_range().await.map(|r| *r.start()).unwrap_or(0)
}
#[zbus(property(emits_changed_signal = "const"))]
async fn tdp_limit_max(&self) -> u32 {
get_tdp_limit_range().await.map(|(_, max)| max).unwrap_or(0)
get_tdp_limit_range().await.map(|r| *r.end()).unwrap_or(0)
}
}