Fix: share a single HID device

Avoid opening multiple handles to the same device whenever possible.
This commit is contained in:
Denis Benato
2025-10-22 22:05:17 +02:00
parent c9e76f3273
commit 180566e5f1
14 changed files with 84 additions and 34 deletions

View File

@@ -83,7 +83,7 @@ impl ScsiZbus {
#[zbus(property)]
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
// entirely possible to deadlock here, so use try instead of lock()
if let Some(config) = self.0.config.try_lock() {
if let Ok(config) = self.0.config.try_lock() {
let mode = config.current_mode;
match config.modes.get(&mode) {
Some(effect) => Ok(effect.clone()),