]> git.baikalelectronics.ru Git - kernel.git/commit
vduse: Tie vduse mgmtdev and its device
authorParav Pandit <parav@nvidia.com>
Mon, 13 Jun 2022 19:52:23 +0000 (22:52 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:33 +0000 (21:24 +0200)
commita6b2cd601b8b3f8d30a7dc70023b5ba94b0bb389
tree2b12a4e1ca405781884c41f43350721ac83dd1ff
parent03ca05d9f8f30a5a41ac2be85b4ba6c357d00f63
vduse: Tie vduse mgmtdev and its device

[ Upstream commit df5b0c9a9a8d04df3e2c55ab32e6dc3eb1364a77 ]

vduse devices are not backed by any real devices such as PCI. Hence it
doesn't have any parent device linked to it.

Kernel driver model in [1] suggests to avoid an empty device
release callback.

Hence tie the mgmtdevice object's life cycle to an allocate dummy struct
device instead of static one.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/core-api/kobject.rst?h=v5.18-rc7#n284

Signed-off-by: Parav Pandit <parav@nvidia.com>
Message-Id: <20220613195223.473966-1-parav@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vdpa/vdpa_user/vduse_dev.c