__v4l2_devic..._until_err_p(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __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 β€” the struct v4l2_device that 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 the struct v4l2_subdev sub-devices associated with v4l2_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 at struct v4l2_subdev_ops that contains f. 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 if cond matches. the operation functions are defined in groups, according to each element at struct v4l2_subdev_ops. iykyk ✨
  • args β€” arguments for f. 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:


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