Re: [PATCH v2 1/5] driver core: add a faux bus for use when a simple device/bus is needed
From: Andy Shevchenko
Date: Wed Feb 05 2025 - 02:57:58 EST
On Wed, Feb 05, 2025 at 06:53:09AM +0100, Greg Kroah-Hartman wrote:
> On Tue, Feb 04, 2025 at 06:10:36PM -0500, Lyude Paul wrote:
> > On Tue, 2025-02-04 at 12:09 +0100, Greg Kroah-Hartman wrote:
...
> > Should we add faux_get_drvdata()/faux_set_drvdata() since we've got a
> > probe/remove function? Doesn't really look like the platform driver equivalent
> > does mcuh, but I assume just having an inline function for this would make
> > things a little less confusing for users.
>
> You already have a reference counted object returned to you, why do you
> need to increment/decrement it again? All of the users I've found in
> the kernel so far didn't need that, do you have a specific example where
> it would be useful?
It's about getter and setter for the .driver_data field, I don't see how
reference counting can help with this.
> I'll be glad to add it, I just didn't think anyone would ever call it.
--
With Best Regards,
Andy Shevchenko