[PATCH v4 16/16] UsbDeviceManager: Make synchronous disconnect method static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dmitry Fleytman <dfleytma@xxxxxxxxxx>

Synchronous disconnection is not a part of public interface anymore.

Signed-off-by: Dmitry Fleytman <dfleytma@xxxxxxxxxx>
---
 src/map-file             |  1 -
 src/usb-device-manager.c | 15 ++++++++-------
 src/usb-device-manager.h |  3 ---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/map-file b/src/map-file
index 35054af..f313d12 100644
--- a/src/map-file
+++ b/src/map-file
@@ -120,7 +120,6 @@ spice_usb_device_get_type;
 spice_usb_device_manager_can_redirect_device;
 spice_usb_device_manager_connect_device_async;
 spice_usb_device_manager_connect_device_finish;
-spice_usb_device_manager_disconnect_device;
 spice_usb_device_manager_disconnect_device_async;
 spice_usb_device_manager_is_redirecting;
 spice_usb_device_manager_get;
diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index ba1c7d2..b326965 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -211,6 +211,9 @@ void _connect_device_async_cb(GObject *gobject,
                               GAsyncResult *channel_res,
                               gpointer user_data);
 
+static void
+_disconnect_device(SpiceUsbDeviceManager *self, SpiceUsbDevice *device);
+
 G_DEFINE_BOXED_TYPE(SpiceUsbDevice, spice_usb_device,
                     (GBoxedCopyFunc)spice_usb_device_ref,
                     (GBoxedFreeFunc)spice_usb_device_unref)
@@ -998,7 +1001,7 @@ static void spice_usb_device_manager_remove_dev(SpiceUsbDeviceManager *self,
     }
 #endif
 
-    spice_usb_device_manager_disconnect_device(self, device);
+    _disconnect_device(self, device);
 
     SPICE_DEBUG("device removed %p", device);
     spice_usb_device_ref(device);
@@ -1672,24 +1675,22 @@ void _connect_device_async_cb(GObject *gobject,
     g_object_unref(result);
     g_free(data);
 }
-#endif
 
 /**
- * spice_usb_device_manager_disconnect_device:
+ * _disconnect_device:
  * @manager: the #SpiceUsbDeviceManager manager
  * @device: a #SpiceUsbDevice to disconnect
  *
  * Returns: %TRUE if @device has an associated USB redirection channel
  */
-void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *self,
-                                                SpiceUsbDevice *device)
+static void
+_disconnect_device(SpiceUsbDeviceManager *self, SpiceUsbDevice *device)
 {
     g_return_if_fail(SPICE_IS_USB_DEVICE_MANAGER(self));
     g_return_if_fail(device != NULL);
 
     SPICE_DEBUG("disconnecting device %p", device);
 
-#ifdef USE_USBREDIR
     SpiceUsbredirChannel *channel;
 
     channel = spice_usb_device_manager_get_channel_for_dev(self, device);
@@ -1701,9 +1702,9 @@ void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *self,
         spice_usb_device_manager_driver_uninstall_async(self,device);
     }
 #endif
+}
 
 #endif
-}
 
 typedef struct _disconnect_cb_data
 {
diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h
index bd10aa9..4fb5709 100644
--- a/src/usb-device-manager.h
+++ b/src/usb-device-manager.h
@@ -117,9 +117,6 @@ void spice_usb_device_manager_disconnect_device_async(
 gboolean spice_usb_device_manager_connect_device_finish(
     SpiceUsbDeviceManager *self, GAsyncResult *res, GError **err);
 
-void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *manager,
-                                                SpiceUsbDevice *device);
-
 gboolean
 spice_usb_device_manager_can_redirect_device(SpiceUsbDeviceManager  *self,
                                              SpiceUsbDevice         *device,
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]