mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
drm/bridge: add drm_bridge_chain_get_last_bridge()
Add an equivalent of drm_bridge_chain_get_first_bridge() to get the last bridge. Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://lore.kernel.org/r/20250801-drm-bridge-alloc-getput-drm_bridge_get_next_bridge-v2-2-888912b0be13@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
parent
cb86408b1f
commit
d77ad5178e
|
|
@ -1410,6 +1410,24 @@ drm_bridge_chain_get_first_bridge(struct drm_encoder *encoder)
|
|||
struct drm_bridge, chain_node));
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_bridge_chain_get_last_bridge() - Get the last bridge in the chain
|
||||
* @encoder: encoder object
|
||||
*
|
||||
* The refcount of the returned bridge is incremented. Use drm_bridge_put()
|
||||
* when done with it.
|
||||
*
|
||||
* RETURNS:
|
||||
* the last bridge in the chain, or NULL if @encoder has no bridge attached
|
||||
* to it.
|
||||
*/
|
||||
static inline struct drm_bridge *
|
||||
drm_bridge_chain_get_last_bridge(struct drm_encoder *encoder)
|
||||
{
|
||||
return drm_bridge_get(list_last_entry_or_null(&encoder->bridge_chain,
|
||||
struct drm_bridge, chain_node));
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_for_each_bridge_in_chain() - Iterate over all bridges present in a chain
|
||||
* @encoder: the encoder to iterate bridges on
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user