devm_iio_device_register(9)
β¨ devm_iio_device_register(9) β¨
okay so bestie, welcome to the kernel API manual π
this lil page is called devm_iio_device_register(9) and it lives in the Kernel API Manual, and honestly? it's a whole vibe. let's get into it π«Ά
πΈ NAME πΈ
devm_iio_device_register β the resource-managed version of iio_device_register(), and yes that "devm_" prefix is doing SO much heavy lifting for you, no cap π
π SYNOPSIS π
devm_iio_device_register (dev , indio_dev );
that's it. two arguments. that's the whole thing. iconic behavior honestly β¨
π¦ ARGUMENTS π¦
devβ the device you're allocating theiio_devfor. it's the parent, it's the main character, it holds the resources π₯indio_devβ the device structure that your device driver already filled in. like, you did that. good job bestie π
π DESCRIPTION π
so this is a managed iio_device_register. the IIO device you register with this function gets automatically unregistered when the driver detaches β literally you don't have to clean up after yourself, the kernel does it for you π§β¨ that's the resource-managed part and it's lowkey the best part.
under the hood this function calls iio_device_register internally, so if you want the full lore, refer to that function for more information. iykyk π
π RETURN π
0on success π- a negative error number on failure π
β SEE ALSO β
the whole extended friend group, fr fr β go say hi:
- Kernel file
./include/linux/iio/iio.hstruct 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)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)dev_to_iio_dev(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)
okay that's the whole page, you ate that π before you go: this came from ./include/linux/iio, dated October 2026, and it's devm_iio_device_register(9) forever and always π bye bestie, go register some devices 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