summaryrefslogtreecommitdiff
path: root/include/kvm
diff options
context:
space:
mode:
authorWei Wang <wei.w.wang@intel.com>2023-02-07 20:37:12 +0800
committerSean Christopherson <seanjc@google.com>2023-06-13 14:18:09 -0700
commit5ea5ca3c2b4bf4090232e18cfc515dcb52f914a6 (patch)
treeceaa5ba4da71e1213afe13f44de19d8db1337137 /include/kvm
parent5f643e460ab1298a32b7d0db104bfcab9d6165c0 (diff)
KVM: destruct kvm_io_device while unregistering it from kvm_io_bus
Current usage of kvm_io_device requires users to destruct it with an extra call of kvm_iodevice_destructor after the device gets unregistered from kvm_io_bus. This is not necessary and can cause errors if a user forgot to make the extra call. Simplify the usage by combining kvm_iodevice_destructor into kvm_io_bus_unregister_dev. This reduces LOCs a bit for users and can avoid the leakage of destructing the device explicitly. Signed-off-by: Wei Wang <wei.w.wang@intel.com> Reviewed-by: Sean Christopherson <seanjc@google.com> Link: https://lore.kernel.org/r/20230207123713.3905-2-wei.w.wang@intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/iodev.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/include/kvm/iodev.h b/include/kvm/iodev.h
index d75fc4365746..56619e33251e 100644
--- a/include/kvm/iodev.h
+++ b/include/kvm/iodev.h
@@ -55,10 +55,4 @@ static inline int kvm_iodevice_write(struct kvm_vcpu *vcpu,
: -EOPNOTSUPP;
}
-static inline void kvm_iodevice_destructor(struct kvm_io_device *dev)
-{
- if (dev->ops->destructor)
- dev->ops->destructor(dev);
-}
-
#endif /* __KVM_IODEV_H__ */