__v4l2_devic..._until_err_p(9)
β¨ __v4l2_devic..._until_err_p(9) β¨
okay bestie, welcome to the Kernel API Manual π
this one is a macro from ./include/media and it's lowkey iconic β it's the "keep going until somebody messes up" version of calling operations on all your subdevs. yes, we're doing kernel media framework gossip today, buckle up π
πΈ NAME πΈ
__v4l2_device_call_subdevs_until_err_p β calls the specified operation for all subdevs matching the condition π¦
like, every single subdev that passes the vibe check (the condition) gets the operation run on it. and the until_err part? that's the main character energy β the moment something errors out it stops, periodt.
π«Ά SYNOPSIS π«Ά
__v4l2_device_call_subdevs_until_err_p (v4l2_dev , sd , cond , o , f ,
args... );
literally just pass everything in and let the macro cook π₯
π ARGUMENTS π
v4l2_devβ thestruct v4l2_devicethat owns the sub-devices we're iterating over. it's giving "landlord of the subdev building" πsdβ a pointer that the macro itself fills in with all thestruct v4l2_subdevsub-devices associated withv4l2_dev. not you, bestie β the macro fills it π«΅condβ the condition to be matched. yes it's literally just "cond", very minimalist of them ngl πoβ name of the element atstruct v4l2_subdev_opsthat containsf. each element there groups a set of operations functions, so it's like picking which drawer of the ops dresser you're opening ποΈfβ the operation function that will be called ifcondmatches. the operation functions are defined in groups, according to each element atstruct v4l2_subdev_ops. iykyk β¨argsβ arguments forf. yes,args...β it's variadic, she contains multitudes π
π DESCRIPTION π
so here's the tea β β if the operation returns an error that is other than 0 or -ENOIOCTLCMD for any subdevice, then it aborts right there and returns with that error code. otherwise? zero. that's it. that's the whole personality π
ngl -ENOIOCTLCMD is the "this subdev doesn't do that, no biggie, keep moving" error β it does not trip the abort. everything else does. π
β NOTE β
subdevs cannot be added or deleted while walking the subdevs list π« no mutating the list mid-walk, bestie, that's undefined-behaviour-adjacent chaos and we don't do that here π
π¦ SEE ALSO π¦
kernel file ./include/media/v4l2-device.h, plus the whole friend group:
struct v4l2_device(9)v4l2_device_get(9)v4l2_device_put(9)v4l2_device_register(9)v4l2_device_set_name(9)v4l2_device_disconnect(9)v4l2_device_unregister(9)v4l2_device_register_subdev(9)v4l2_device_unregister_subdev(9)__v4l2_device_register_subdev_nodes(9)v4l2_device_register_subdev_nodes(9)v4l2_device_register_ro_subdev_nodes(9)v4l2_subdev_notify(9)v4l2_device_supports_requests(9)v4l2_device_for_each_subdev(9)__v4l2_device_call_subdevs_p(9)__v4l2_device_call_subdevs(9)__v4l2_device_call_subdevs_until_err(9)v4l2_device_call_all(9)v4l2_device_call_until_err(9)v4l2_device_mask_call_all(9)v4l2_device_mask_call_until_err(9)v4l2_device_has_op(9)v4l2_device_mask_has_op(9)
and that's the whole page, bestie π this lil drop came to you from ./include/media, dated October 2026, and the page itself is __v4l2_devic..._until_err_p(9) β truncated name and all, she's mysterious like that π mwah, go call some subdevs responsibly β¨π§
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms