Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Sakari Ailus and committed by
Hans Verkuil
7d30b8ef 40431ff5

+5 -1
+5 -1
drivers/media/v4l2-core/v4l2-async.c
··· 323 323 sd->entity.function != MEDIA_ENT_F_FLASH) 324 324 return 0; 325 325 326 - if (!n->sd) 326 + if (!n->sd) { 327 + dev_warn(notifier_dev(n), 328 + "not a sub-device notifier, not creating an ancillary link for %s!\n", 329 + dev_name(sd->dev)); 327 330 return 0; 331 + } 328 332 329 333 link = media_create_ancillary_link(&n->sd->entity, &sd->entity); 330 334