vDPA/ifcvf: allocate the adapter in dev_add()
authorZhu Lingshan <lingshan.zhu@intel.com>
Fri, 25 Nov 2022 14:57:22 +0000 (22:57 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 21 Feb 2023 00:26:55 +0000 (19:26 -0500)
commit93139037b582134deb1ed894bbc4bc1d34ff35e7
tree41165b04f25326aaaf8763ffa64b819f709e8ffb
parent6a3b2f179b49f2c6452ecc37b4778a43848b454c
vDPA/ifcvf: allocate the adapter in dev_add()

The adapter is the container of the vdpa_device,
this commits allocate the adapter in dev_add()
rather than in probe(). So that the vdpa_device()
could be re-created when the userspace creates
the vdpa device, and free-ed in dev_del()

Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com>
Cc: stable@vger.kernel.org
Message-Id: <20221125145724.1129962-11-lingshan.zhu@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/ifcvf/ifcvf_main.c