Skip to contentSkip to conversation

media: async: Warn on attept to create an ancillary link to a non-subdev

PATCH New Sakari Ailus 1 participant 1 message May 20, 2024

Subsystems (2)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 media: async: Warn on attept to create an ancillary link to a non-subdev

Warn if a lens or a flash async sub-device is bound to a non-sub-device notifier. This isn't meaningful and unlikely to happen in practice but print a warning as we nevertheless won't consider this an error.

---
 drivers/media/v4l2-core/v4l2-async.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/media/v4l2-core/v4l2-async.c +5 -1
index c477723c07bf..81a9b5473969 100644
@@ -323,8 +323,12 @@ static int v4l2_async_create_ancillary_links(struct v4l2_async_notifier *n,
 	    sd->entity.function != MEDIA_ENT_F_FLASH)
 		return 0;
 
-	if (!n->sd)
+	if (!n->sd) {
+		dev_warn(notifier_dev(n),
+			 "not a sub-device notifier, not creating an ancillary link for %s!\n",
+			 dev_name(sd->dev));
 		return 0;
+	}
 
 	link = media_create_ancillary_link(&n->sd->entity, &sd->entity);
 
Signature · 1 line
2.39.2