aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-12-11 17:05:06 -0500
committerEduardo Habkost <ehabkost@redhat.com>2020-12-15 10:02:07 -0500
commit828ade86ee925c132496113e7f88b22162d92ec5 (patch)
tree47bc5ecbf809d27330a09555c21bea5d605ddf46 /backends
parent605d9fc0e307fb105d539e968b12bb0c46436bfa (diff)
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 <ehabkost@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> #s390 parts Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20201211220529.2290218-10-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'backends')
-rw-r--r--backends/tpm/tpm_util.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c
index e6aeb63587..3973105658 100644
--- a/backends/tpm/tpm_util.c
+++ b/backends/tpm/tpm_util.c
@@ -35,8 +35,7 @@
static void get_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
Error **errp)
{
- DeviceState *dev = DEVICE(obj);
- TPMBackend **be = qdev_get_prop_ptr(dev, opaque);
+ TPMBackend **be = qdev_get_prop_ptr(obj, opaque);
char *p;
p = g_strdup(*be ? (*be)->id : "");
@@ -49,7 +48,7 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
{
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
- TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
+ TPMBackend *s, **be = qdev_get_prop_ptr(obj, prop);
char *str;
if (dev->realized) {
@@ -73,9 +72,8 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
static void release_tpm(Object *obj, const char *name, void *opaque)
{
- DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
- TPMBackend **be = qdev_get_prop_ptr(dev, prop);
+ TPMBackend **be = qdev_get_prop_ptr(obj, prop);
if (*be) {
tpm_backend_reset(*be);