Re: [PATCH v2 1/5] driver core: add a faux bus for use when a simple device/bus is needed

From: Greg Kroah-Hartman
Date: Wed Feb 05 2025 - 03:58:43 EST


On Wed, Feb 05, 2025 at 09:57:32AM +0200, Andy Shevchenko wrote:
> 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.

{sigh}

I saw get and thought get_device() as my coffee hadn't kicked in, my
fault.

You both are right, I'll go add these wrappers.

thanks,

greg k-h