[PATCH 0/5] of: More 'device' vs. 'module' cleanups

Rob Herring robh at kernel.org
Thu Jun 8 18:49:03 UTC 2023


On Wed, May 10, 2023 at 05:47:58PM +0200, Miquel Raynal wrote:
> Hello,
> 
> As part of a previous series, Rob suggested that keeping too much logic
> in of/device.c was backward and would benefit from a gradual cleanup
> with the hope some day to move the remaining helpers into inline
> functions wrapping the proper of_*() methods.

Where I'm at on device.c is it should be functions that bus 
implementations need. I have a ton of tree wide changes to disentangle 
of_device.h and of_platform.h. Some of that landed in 6.4.

uevents are pretty much tied to struct device and the bus, so I don't 
think moving these parts to module.c makes sense unless there is a need 
for the functionality without a struct device. 

Also, perhaps we want to make module.c configurable?:

obj-$(CONFIG_MODULE) += module.o

The uevent stuff is certainly independent of module support.

> Link: https://lore.kernel.org/lkml/CAL_JsqJE43qfYzHUuCJsbaPPBTbYX05Q7FFmPTjPFZ3Dmz_mXg@mail.gmail.com/
> 
> A few of these "conversions" happened in the series I was originally
> working on. At this time I actually wrote a few other changes,
> completely unrelated to my original series, but still following Rob's
> cleanup idea: here they are.
> 
> Link: https://lore.kernel.org/lkml/20230307165359.225361-1-miquel.raynal@bootlin.com/
> 
> The last step of this series is to actually remove a copy of one of
> these helpers which I think is not needed. This drivers/gpu/ patch
> depends on the previous changes.
> 
> Thanks, Miquèl
> 
> Miquel Raynal (5):
>   of: module: Mutate of_device_modalias() into two helpers
>   of: module: Mutate of_device_uevent() into two helpers
>   of: module: Mutate of_device_uevent_modalias() into two helpers
>   of: module: Export of_uevent()
>   gpu: host1x: Stop open-coding of_device_uevent()

This last patch is certainly worthwhile doing.

Rob


More information about the dri-devel mailing list