devm_iio_channel_get_all(9)
π devm_iio_channel_get_all π
okay so this is a page from the Kernel API Manual, and it's literally about grabbing ALL your IIO channels in one go, but the managed way, bestie. resource-managed. devm-style. we love a self-cleaning situation β¨
πΈ NAME πΈ
devm_iio_channel_get_all β the resource managed version of iio_channel_get_all(). that's it, that's the vibe. π
β¨ SYNOPSIS β¨
struct iio_channel * devm_iio_channel_get_all (struct device *dev );
like, you hand it a device and it hands you back a pointer to channels. simple as. π«Ά
π¦ ARGUMENTS π¦
devβ Pointer to consumer device. this is the device that's gonna consume the channels, so it's kind of a main character here π
π₯ DESCRIPTION π₯
So here's the tea: it returns a pointer to a negative errno if it can't get the iio channel π β but if it does pull it off, you get back an array of iio_channel structures, and that array is terminated with one whose iio_dev pointer is null. that's your little end-of-list marker, iykyk π©
This function is used by fairly generic consumers to get all the channels registered as having this consumer. no cap, that's the whole point.
And the best part?? The allocated iio channels are automatically released when the device is unbounded. literally free real estate cleanup, devm could never be messy π
ok but real talk β the auto-release is a devm thing, so don't go releasing them yourself and then acting surprised. that's the whole point of "resource managed." slay responsibly π
π SEE ALSO π
the whole friend group, fr fr. go check these out:
- Kernel file
./include/linux/iio/consumer.hβ the header these live in, the mothership π struct iio_channel(9)iio_channel_get(9)iio_channel_release(9)devm_iio_channel_get(9)iio_channel_get_all(9)iio_channel_release_all(9)fwnode_iio_channel_get_by_name(9)devm_fwnode_iio_channel_get_by_name(9)iio_channel_get_all_cb(9)iio_channel_cb_set_buffer_watermark(9)iio_channel_release_all_cb(9)iio_channel_start_all_cb(9)iio_channel_stop_all_cb(9)iio_channel_cb_get_channels(9)iio_channel_cb_get_iio_dev(9)iio_read_channel_raw(9)iio_read_channel_average_raw(9)iio_read_channel_processed(9)iio_read_channel_processed_scale(9)iio_write_channel_attribute(9)iio_read_channel_attribute(9)iio_write_channel_raw(9)iio_read_max_channel_raw(9)iio_read_min_channel_raw(9)iio_read_avail_channel_raw(9)iio_read_avail_channel_attribute(9)iio_get_channel_type(9)iio_read_channel_offset(9)iio_read_channel_scale(9)iio_multiply_value(9)iio_convert_raw_to_processed(9)iio_get_channel_ext_info_count(9)iio_read_channel_ext_info(9)iio_write_channel_ext_info(9)iio_read_channel_label(9)
ok that's the whole page bestie, go read the source and hydrate π
cute little sign-off: this icon lives in ./include/linux/iio and the version/date situation is October 2026 β historical document, treat it with respect π«‘πΈ
devm_iio_channel_get_all(9) π periodt.
π¦ 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