From: Philippe Mathieu-Daudé Date: Mon, 13 Feb 2023 17:01:41 +0000 (+0100) Subject: hw/vfio/ccw: Simplify using DEVICE() macro X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4c8a2054e78780622f5d005a52e0bc000f87eb93;p=qemu.git hw/vfio/ccw: Simplify using DEVICE() macro 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é Reviewed-by: Eric Farman Message-Id: <20230213170145.45666-3-philmd@linaro.org> Signed-off-by: Thomas Huth --- diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 0354737666..503de94ce1 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -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;