mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
vhost/vsock: use static minor number
Vhost-vsock is a software device so there is no probe call that causes the driver to register its misc char device node. This creates a chicken and egg problem: userspace applications must open /dev/vhost-vsock to use the driver but the file doesn't exist until the kernel module has been loaded. Use the devname modalias mechanism so that /dev/vhost-vsock is created at boot. The vhost_vsock kernel module is automatically loaded when the first application opens /dev/host-vsock. Note that the "reserved for local use" range in Documentation/admin-guide/devices.txt is incorrect. The userio driver already occupies part of that range. I've updated the documentation accordingly. Cc: [email protected] Signed-off-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
ff35eb23de
commit
f4660cc994
3 changed files with 7 additions and 2 deletions
|
|
@ -706,7 +706,7 @@ static const struct file_operations vhost_vsock_fops = {
|
|||
};
|
||||
|
||||
static struct miscdevice vhost_vsock_misc = {
|
||||
.minor = MISC_DYNAMIC_MINOR,
|
||||
.minor = VHOST_VSOCK_MINOR,
|
||||
.name = "vhost-vsock",
|
||||
.fops = &vhost_vsock_fops,
|
||||
};
|
||||
|
|
@ -778,3 +778,5 @@ module_exit(vhost_vsock_exit);
|
|||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_AUTHOR("Asias He");
|
||||
MODULE_DESCRIPTION("vhost transport for vsock ");
|
||||
MODULE_ALIAS_MISCDEV(VHOST_VSOCK_MINOR);
|
||||
MODULE_ALIAS("devname:vhost-vsock");
|
||||
|
|
|
|||
Loading…
Reference in a new issue