From: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> This way the pads are always passed to the has_route() op sink pad first. Makes sense. Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> --- drivers/media/media-entity.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 2e5958732a9735cf..88c8b838b78b39aa 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -249,6 +249,10 @@ bool media_entity_has_route(struct media_entity *entity, unsigned int pad0, if (!entity->ops || !entity->ops->has_route) return true; + if (entity->pads[pad0].flags & MEDIA_PAD_FL_SOURCE + && entity->pads[pad1].flags & MEDIA_PAD_FL_SINK) + swap(pad0, pad1); + return entity->ops->has_route(entity, pad0, pad1); } EXPORT_SYMBOL_GPL(media_entity_has_route); -- 2.18.0