From f3a97a001b8b6f0e044fa662d19409a7036de4a4 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Thu, 19 Dec 2019 19:03:24 +0000 Subject: [PATCH] char-device: Use red_char_device_get_device_instance to retrieve character instance Signed-off-by: Frediano Ziglio --- server/red-stream-device.c | 4 ++-- server/smartcard.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/red-stream-device.c b/server/red-stream-device.c index 15262334..53d89210 100644 --- a/server/red-stream-device.c +++ b/server/red-stream-device.c @@ -707,8 +707,8 @@ reset_channels(StreamDevice *dev) static void char_device_set_state(RedCharDevice *char_dev, int state) { - SpiceCharDeviceInstance *sin = NULL; - g_object_get(char_dev, "sin", &sin, NULL); + SpiceCharDeviceInstance *sin; + sin = red_char_device_get_device_instance(char_dev); spice_assert(sin != NULL); SpiceCharDeviceInterface *sif = spice_char_device_get_interface(sin); diff --git a/server/smartcard.c b/server/smartcard.c index 961633f0..9a536064 100644 --- a/server/smartcard.c +++ b/server/smartcard.c @@ -369,7 +369,7 @@ void smartcard_char_device_detach_client(RedCharDeviceSmartcard *smartcard, SpiceCharDeviceInterface *sif; SpiceCharDeviceInstance *sin; - g_object_get(smartcard, "sin", &sin, NULL); + sin = red_char_device_get_device_instance(RED_CHAR_DEVICE(smartcard)); sif = spice_char_device_get_interface(sin); spice_assert(smartcard->priv->scc == scc);