From 828ade86ee925c132496113e7f88b22162d92ec5 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Fri, 11 Dec 2020 17:05:06 -0500 Subject: qdev: Make qdev_get_prop_ptr() get Object* arg Make the code more generic and not specific to TYPE_DEVICE. Signed-off-by: Eduardo Habkost Reviewed-by: Marc-André Lureau Reviewed-by: Cornelia Huck #s390 parts Acked-by: Paul Durrant Message-Id: <20201211220529.2290218-10-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- hw/vfio/pci-quirks.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hw/vfio') diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 57150913b7..53569925a2 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -1488,9 +1488,8 @@ static void get_nv_gpudirect_clique_id(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - DeviceState *dev = DEVICE(obj); Property *prop = opaque; - uint8_t *ptr = qdev_get_prop_ptr(dev, prop); + uint8_t *ptr = qdev_get_prop_ptr(obj, prop); visit_type_uint8(v, name, ptr, errp); } @@ -1501,7 +1500,7 @@ static void set_nv_gpudirect_clique_id(Object *obj, Visitor *v, { DeviceState *dev = DEVICE(obj); Property *prop = opaque; - uint8_t value, *ptr = qdev_get_prop_ptr(dev, prop); + uint8_t value, *ptr = qdev_get_prop_ptr(obj, prop); if (dev->realized) { qdev_prop_set_after_realize(dev, name, errp); -- cgit v1.2.3-55-g7522