Re: [PATCH 4/4] rust: samples: add EDU PCI driver sample
From: Miguel Ojeda
Date: Tue Jun 16 2026 - 08:59:30 EST
On Mon, Jun 15, 2026 at 12:12 PM Ewan Chorynski <ewan.chorynski@xxxxx> wrote:
>
> You can replace the if block with read_poll_timeout(...).inspect_err(|_| dev_err!(pdev, ...))?;
Hmm... I am not sure why the code explicitly mentions `ETIMEDOUT`
instead of forwarding it.
An explicit early return with `if let` would look fine, and I tend to
expect `inspect` for longer chains, but it is true that elsewhere I
see `read_poll_timeout` being used with `inspect_err`, so it looks
like people is fond of the approach.
On the other hand, I am also seeing:
let _ = hal.write_sysmem_flush_page(bar, 0).inspect_err(|e| {
dev_warn!(
&self.device,
"failed to unregister sysmem flush page: {:?}\n",
e
)
});
So we may be overdoing it too.
Thanks for reviewing!
(By the way, if you can, please remember to trim your replies, so that
it is easier to read in e.g. lore.kernel.org etc. :)
Cheers,
Miguel