[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025122138-saucy-unexpired-0b98@gregkh>
Date: Sun, 21 Dec 2025 17:10:06 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Markus Probst <markus.probst@...teo.de>
Cc: Rob Herring <robh@...nel.org>, Jiri Slaby <jirislaby@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Kari Argillander <kari.argillander@...il.com>,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH RFC 1/4] serdev: Export internal is_serdev_device() for
drivers
On Sat, Dec 20, 2025 at 06:44:05PM +0000, Markus Probst wrote:
> From: Kari Argillander <kari.argillander@...il.com>
>
> The serdev core has an internal is_serdev_device() helper, but it was
> not accessible to drivers. Make it public by declaring it in serdev.h
> and exporting the symbol so that modular serdev drivers can rely on it
> instead of duplicating type checks.
>
> This allows example future Rust serdev abstraction to have
>
> TryFrom<&device::Device<Ctx>> for &serdev::Device<Ctx>
But why is that going to be needed?
> That way using bus is easy for other substystems. Also some other
> subsystems expose similar function:
>
> - bool is_usb_device(const struct device *dev)
> - bool dev_is_pci(const struct device *dev)
Yes, and usually that's not a good idea, unless you have a bus with
multiple types of devices on it. I don't think serdev has that, does
it?
Only under special circumstances should this be required, so I'm curious
as to why you would ever have a pointer to a struct device and not
"know" that it is of this type? Who is passing that to you?
thanks,
greg k-h
Powered by blists - more mailing lists