v4l2_device_set_name(9)
π v4l2_device_set_name(9) π
okay bestie, welcome to the Kernel API Manual page for v4l2_device_set_name(9) β itβs giving optional function realness, and yes, weβre about to make the name field of struct &v4l2_device make sense π«Ά
β¨ NAME β¨
v4l2_device_set_name β optional function to initialize the name field of struct &v4l2_device
πΈ SYNOPSIS πΈ
int v4l2_device_set_name (struct v4l2_device *v4l2_dev , const char
*basename , atomic_t *instance );
π ARGUMENTS π
v4l2_devβ pointer tostruct v4l2_devicebasenameβ base name for the device nameinstanceβ pointer to a staticatomic_tvar with the instance usage for the device driver.
π DESCRIPTION π
v4l2_device_set_name initializes the name field of struct v4l2_device using the driver name and a driver-global atomic_t instance.
This function will increment the instance counter and returns the instance value used in the name.
π¦ EXAMPLE π¦
static atomic_t drv_instance = ATOMIC_INIT(0);
...
instance = v4l2_device_set_name(& v4l2_dev, "foo", & drv_instance);
The first time this is called the name field will be set to foo0 and this function returns 0. If the name ends with a digit (e.g. cx18), then the name will be set to cx18-0 since cx180 would look really odd.
π₯ SEE ALSO π₯
Kernel file ./include/media/v4l2-device.h:
struct v4l2_device(9)v4l2_device_get(9)v4l2_device_put(9)v4l2_device_register(9)v4l2_device_disconnect(9)v4l2_device_unregister(9)v4l2_device_register_subdev(9)v4l2_device_unregister_subdev(9)__v4l2_device_register_subdev_nodes(9)v4l2_device_register_subdev_nodes(9)v4l2_device_register_ro_subdev_nodes(9)v4l2_subdev_notify(9)v4l2_device_supports_requests(9)v4l2_device_for_each_subdev(9)__v4l2_device_call_subdevs_p(9)__v4l2_device_call_subdevs(9)__v4l2_device_call_subdevs_until_err_p(9)__v4l2_device_call_subdevs_until_err(9)v4l2_device_call_all(9)v4l2_device_call_until_err(9)v4l2_device_mask_call_all(9)v4l2_device_mask_call_until_err(9)v4l2_device_has_op(9)v4l2_device_mask_has_op(9)
thatβs the whole vibe, bestie π this one lives under ./include/media, is dated October 2026, and belongs to the v4l2_device_set_name(9) title β mwah π
π¦ 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