dev_to_iio_dev(9)
β¨ dev_to_iio_dev(9) β bestie edition β¨
okay so this is a page from the Kernel API Manual, section 9, and it's genuinely so short you could read it in a TikTok-length attention span π like, one function, one argument, one giant warning. it's giving "small but mighty."
π NAME π
dev_to_iio_dev β Get IIO device struct from a device struct
literally what it says on the tin, bestie. you hand it a struct device and it hands you back the struct iio_dev that device is chillin' inside of. slay.
π¦ SYNOPSIS π¦
struct iio_dev * dev_to_iio_dev (struct device *dev );
πΈ ARGUMENTS πΈ
devβ The device embedded in the IIO device. yes, embedded. it's inside. tucked in. cozy. π«Ά
π NOTE π
The device must be a IIO device, otherwise the result is undefined.
no cap, this is the important bit. if what you pass in is not an IIO device, there's no error, no nice little NULL, no warning β the result is just undefined. that's the manpage's way of saying "you're on your own, bestie π«Ά". so like, do the vibe check on your device before you call this. iykyk.
π SEE ALSO π
it's a whole friend group, fr fr. the kernel file ./include/linux/iio/iio.h and then all of these:
struct iio_chan_spec_ext_info(9)struct iio_enum(9)IIO_ENUM(9)IIO_ENUM_AVAILABLE(9)struct iio_mount_matrix(9)IIO_MOUNT_MATRIX(9)struct iio_event_spec(9)IIO_SCAN_FORMAT_SIGNED_INT(9)IIO_SCAN_FORMAT_UNSIGNED_INT(9)IIO_SCAN_FORMAT_FLOAT(9)struct iio_scan_type(9)struct iio_chan_spec(9)iio_channel_has_info(9)iio_channel_has_available(9)struct iio_info(9)struct iio_buffer_setup_ops(9)struct iio_dev(9)iio_device_register(9)devm_iio_device_register(9)iio_device_claim_direct(9)iio_device_release_direct(9)iio_device_try_claim_buffer_mode(9)iio_device_release_buffer_mode(9)IIO_DEV_ACQUIRE_DIRECT_MODE(9)IIO_DEV_ACQUIRE_FAILED(9)IIO_DEV_GUARD_CURRENT_MODE(9)iio_device_put(9)iio_device_get(9)iio_device_set_parent(9)iio_device_set_drvdata(9)iio_device_get_drvdata(9)IIO_DECLARE_BUFFER_WITH_TS(9)IIO_DECLARE_DMA_BUFFER_WITH_TS(9)IIO_DECLARE_QUATERNION(9)iio_get_debugfs_dentry(9)iio_device_suspend_triggering(9)iio_device_resume_triggering(9)iio_get_current_scan_type(9)iio_get_masklength(9)iio_for_each_active_channel(9)IIO_DEGREE_TO_RAD(9)IIO_RAD_TO_DEGREE(9)IIO_G_TO_M_S_2(9)IIO_M_S_2_TO_G(9)
like i said. huge friend group. π
π§ sign-off π§
and that's the whole page!! it came from the source ./include/linux/iio, dated October 2026, and it's living in the Kernel API Manual as dev_to_iio_dev(9). go forth and convert those device structs responsibly, bestie ππ
π¦ 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