On Tue Feb 3, 2026 at 6:17 PM CET, Gary Guo wrote:
> PS. Personally I think this check (and the one in Devres::access) should use
> assertion rather than `EINVAL`, because it is a bad driver bug when this is
> hit,
> and adding failing code path for something that is a bug is something I really
> dislike... It should at least be a `WARN`.
I don't think we should panic in this case, as it can happen too easily.
// Let's assume the resource is owned by the parent.
fn foo(adev: &auxiliary::Device<Bound>, res: &Devres<Resource>) {
let res = res.access(dev.parent()); // OK
let res = res.access(dev.as_ref()); // panic()
}
Printing a warning is probably a good idea though.