lkml.org 
[lkml]   [2021]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 0/4] driver_core: Auxiliary drvdata helper cleanup
From
Date
On Tue, 2021-12-21 at 20:09 -0400, Jason Gunthorpe wrote:
> On Tue, Dec 21, 2021 at 03:58:48PM -0800, David E. Box wrote:
> > Depends on "driver core: auxiliary bus: Add driver data helpers" patch [1].
> > Applies the helpers to all auxiliary device drivers using
> > dev_(get/set)_drvdata. Drivers were found using the following search:
> >
> > grep -lr "struct auxiliary_device" $(grep -lr "drvdata" .)
> >
> > Changes were build tested using the following configs:
> >
> > vdpa/mlx5: CONFIG_MLX5_VDPA_NET
> > net/mlx53: CONFIG_MLX5_CORE_EN
> > soundwire/intel: CONFIG_SOUNDWIRE_INTEL
> > RDAM/irdma: CONFIG_INFINIBAND_IRDMA
> > CONFIG_MLX5_INFINIBAND
> >
> > [1] https://www.spinics.net/lists/platform-driver-x86/msg29940.html
>
> I have to say I don't really find this to be a big readability
> improvement.

I should have referenced the thread [1] discussing the benefit of this change
since the question was asked and answered already. The idea is that drivers
shouldn't have to touch the device API directly if they are already using a
higher level core API (auxiliary bus) that can do that on its behalf.

One benefit of this scheme is that it limits the number of places where changes
need to be made if the device core were to change.

[1] https://lore.kernel.org/all/YbBwOb6JvWkT3JWI@kroah.com/

>
> Also, what use is 'to_auxiliary_dev()' ? I didn't see any users added..

This was not added by that patch.

Thanks

David
>
> Jason

\
 
 \ /
  Last update: 2021-12-22 01:49    [W:0.081 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site