register_virtio_device(9)
π NAME π
register_virtio_device β register virtio device β¨
okay so real talk, this is a page from the Kernel API Manual, and it's literally all about register_virtio_device(9). bestie, let's get into it π«Ά
πΈ SYNOPSIS πΈ
int register_virtio_device (struct virtio_device *dev );
π ARGUMENTS π
devβ the virtio device to be registered π that's the whole vibe.
π¦ DESCRIPTION π¦
So here's the part you cannot skip, bestie. On error, the caller must call put_device on &dev->dev β and not kfree π β because another code path may have obtained a reference to dev.
fr fr, do not kfree it. the reference situation is giving "someone else is holding onto this" and you have to respect that π«Ά
β RETURN β
0on success π slay.-erroron failure π
π SEE ALSO π
Kernel file ./drivers/virtio/virtio.c:
virtio_config_driver_disable(9)virtio_config_driver_enable(9)virtio_reset_device(9)virtio_device_shutdown(9)
mwah π sign-off time: source/version is ./drivers/virtio, dated October 2026, and the manual page is register_virtio_device(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