]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/vfio/ccw: Simplify using DEVICE() macro
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 13 Feb 2023 17:01:41 +0000 (18:01 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 27 Feb 2023 08:15:38 +0000 (09:15 +0100)
QOM parenthood relationship is:

  VFIOCCWDevice -> S390CCWDevice -> CcwDevice -> DeviceState

We can directly use the QOM DEVICE() macro to get the parent object.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <20230213170145.45666-3-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/vfio/ccw.c

index 0354737666a19dea5fb3c2c5834f7e950db41add..503de94ce182c9edd1d2db8e951ac3ea4962cdda 100644 (file)
@@ -618,7 +618,7 @@ static void vfio_ccw_get_device(VFIOGroup *group, VFIOCCWDevice *vcdev,
     vcdev->vdev.ops = &vfio_ccw_ops;
     vcdev->vdev.type = VFIO_DEVICE_TYPE_CCW;
     vcdev->vdev.name = name;
-    vcdev->vdev.dev = &vcdev->cdev.parent_obj.parent_obj;
+    vcdev->vdev.dev = DEVICE(vcdev);
 
     return;