__v4l2_devic...ll_subdevs_p(9)
π __v4l2_device_call_subdevs_p π
okay so real talk, this is a page out of the Kernel API Manual and it's lowkey iconic once you get what it does π«Ά the name is __v4l2_device_call_subdevs_p and it's giving "my underscore prefixes are load-bearing" energy, iykyk.
β¨ NAME β¨
__v4l2_device_call_subdevs_p β Calls the specified operation for all subdevs matching the condition. that's the whole vibe fr fr π
π¦ SYNOPSIS π¦
__v4l2_device_call_subdevs_p (v4l2_dev , sd , cond , o , f , args... );
like yes bestie it's a macro, yes it takes a whole little gang of arguments, no we're not scared of it π
π ARGUMENTS π
v4l2_devβ thestruct v4l2_devicethat owns the sub-devices you're iterating over. it's the main character here, everything belongs to it πsdβ a pointer that the macro itself fills in with allstruct v4l2_subdevpointer used as an iterator by the loop. so like, don't you worry about assigning it, the macro's got you β¨condβ condition to be match. if it hits, the operation goes brrr π₯oβ name of the element atstruct v4l2_subdev_opsthat containsf. each element in there groups a set of operations functions, so think ofoas picking which lil squad you're rolling with πfβ the operation function that will be called ifcondmatches. the operation functions are defined in groups, according to each element atstruct v4l2_subdev_opsβ sooandfare besties, they go together πargsβ arguments forf. pass them through, no cap π
πΈ DESCRIPTION πΈ
Ignore any errors.
genuinely that's it. that's the description. it goes through everything and if something goes wrong it simply does not care π not me being emotionally unbothered, that's literally the documented behaviour, periodt π
β NOTE β
subdevs cannot be added or deleted while walking the subdevs list.
read that again bestie!! π¨ no adding, no deleting, no funny business while the loop is walking. you're on a moving sidewalk, you don't redecorate the sidewalk. that's the whole warning, respect it π
π§ SEE ALSO π§
Kernel file ./include/media/v4l2-device.h and honestly 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(9)__v4l2_device_call_subdevs_until_err_p(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 page!! π₯³ source is ./include/media, dated October 2026, and the header/footer vibe is __v4l2_devic...ll_subdevs_p(9) β yes the truncation is part of the aesthetic, slay πβ¨π ily, 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