[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aA_xUWQt6-UCdlGM@cassiopeiae>
Date: Mon, 28 Apr 2025 23:21:21 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Rob Herring <robh@...nel.org>
Cc: Dirk Behme <dirk.behme@...bosch.com>, Dirk Behme <dirk.behme@...il.com>,
Remo Senekowitsch <remo@...nzli.dev>,
Saravana Kannan <saravanak@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v3 3/7] rust: property: Introduce PropertyGuard
On Mon, Apr 28, 2025 at 03:48:40PM -0500, Rob Herring wrote:
>
> One thing that's really hard to debug in C drivers is where an
> error came from. You can for example turn on initcall_debug and see that
> a driver probe returned an error. It's virtually impossible to tell
> where that originated from. The only way to tell is with prints. That is
> probably the root of why probe has so many error prints. I think we can
> do a lot better with rust given Result can hold more than just an int.
This I fully agree with, not sure if the solution is to put more stuff into the
Result type though. However, there are things like #[track_caller] (also
recently mentioned by Benno), which might be a good candidate for improving this
situation.
As mentioned, for now let's go with
pub fn required_by(self, dev: &Device) -> Result<T>
additional to required() for this purpose to get a proper dev_err() print.
Powered by blists - more mailing lists