xhcid: fix syntax error in get_desc after root_hub_port_index() Option refactor

This commit is contained in:
Red Bear OS
2026-07-08 23:49:42 +03:00
parent efa24228e3
commit 4f5495acc6
+1 -2
View File
@@ -1846,8 +1846,7 @@ impl<const N: usize> Xhci<N> {
pub async fn get_desc(&self, port_id: PortId, slot: u8) -> Result<DevDesc> {
let ports = self.ports.lock().unwrap_or_else(|e| e.into_inner());
let idx = port_id.root_hub_port_index().ok_or(Error::new(EINVAL))?;
let port = ports.get(idx).ok_or(Error::new(EINVAL))?;
.ok_or(Error::new(ENOENT))?;
let port = ports.get(idx).ok_or(Error::new(ENOENT))?;
if !port.flags().contains(port::PortFlags::CCS) {
return Err(Error::new(ENOENT));
}