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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:42 +0000 (13:55 +0100)
commitbeb15de99ae8fb4d270cb9b55509b72826a1b63d
tree89ee4ae2bb9744d495328398ca093d0a854352ef
parentdd5d2d8821b2afda55219742b418369fa23b57f2
vDPA/ifcvf: allocate the adapter in dev_add()

commit 93139037b582134deb1ed894bbc4bc1d34ff35e7 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vdpa/ifcvf/ifcvf_main.c