char-device: Use red_char_device_get_device_instance to retrieve character instance

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Frediano Ziglio 2019-12-19 19:03:24 +00:00
parent 1e13fb13c7
commit f3a97a001b
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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);