[PATCH 01/26] drm/bridge: add drm_of_find_bridge()

Luca Ceresoli luca.ceresoli at bootlin.com
Mon Nov 24 08:03:00 PST 2025


Hello Maxime,

On Mon Nov 24, 2025 at 11:15 AM CET, Maxime Ripard wrote:
> Hi,
>
> On Wed, Nov 19, 2025 at 02:05:32PM +0100, Luca Ceresoli wrote:
>>  #ifdef CONFIG_OF
>> +/**
>> + * drm_of_find_bridge - find the bridge corresponding to the device node in
>> + *			the global bridge list
>> + * @np: device node
>> + *
>> + * The refcount of the returned bridge is incremented. Use drm_bridge_put()
>> + * when done with it.
>> + *
>> + * RETURNS:
>> + * drm_bridge control struct on success, NULL on failure
>> + */
>> +struct drm_bridge *drm_of_find_bridge(struct device_node *np)
>
> So the convention we've mostly had was that the first argument would
> define the prefix, ie. if we pass a drm_* pointer, the prefix is drm, if
> we pass a device_node pointer, then the prefix is of.
>
> Considering that convention, of_drm_find_bridge would be the ideal
> candidate, but we can't use that obviously. What about
> of_drm_find_and_get_bridge, or of_drm_get_bridge?

Ah, it sounded the other way around during the old discussion [0]. :-) But
no problem in using a different name of course. of_drm_get_bridge() looks
like the best to me, so I'll rename that way in v2.

[0] https://lore.kernel.org/dri-devel/20250319-stylish-lime-mongoose-0a18ad@houat/

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-amlogic mailing list