diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-10 08:39:28 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-06 20:06:45 +0200 |
commit | a1ffbdf1c8fef089e8c114649ed2161bab2aaaa6 (patch) | |
tree | 4101cd9f471277bb69e51a2d4f6e6b1001b20e91 | |
parent | c1c3702f5336b7e759afc7d8b51a7422b18098ed (diff) |
plugin-manager: find port support is now only an internal operation
-rw-r--r-- | src/mm-plugin-manager.c | 41 | ||||
-rw-r--r-- | src/mm-plugin-manager.h | 14 |
2 files changed, 23 insertions, 32 deletions
diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c index c3f94ab4..0b637f5d 100644 --- a/src/mm-plugin-manager.c +++ b/src/mm-plugin-manager.c @@ -54,6 +54,8 @@ struct _MMPluginManagerPrivate { GHashTable *supports; }; +/*****************************************************************************/ + /* List of support infos associated to the same physical device */ typedef struct { GSList *info_list; @@ -77,8 +79,6 @@ typedef struct { MMPlugin *best_plugin; } SupportsInfo; -static gboolean find_port_support_idle (SupportsInfo *info); - static void supports_info_free (SupportsInfo *info) { @@ -151,6 +151,11 @@ remove_supports_info (MMPluginManager *self, /* Note that we just remove it from the list, we don't free it */ } +/*****************************************************************************/ +/* Find port support */ + +static gboolean find_port_support_idle (SupportsInfo *info); + static void suggest_supports_info_result (MMPluginManager *self, const gchar *physdev_path, @@ -409,10 +414,10 @@ find_port_support_idle (SupportsInfo *info) return FALSE; } -MMPlugin * -mm_plugin_manager_find_port_support_finish (MMPluginManager *self, - GAsyncResult *result, - GError **error) +static MMPlugin * +find_port_support_finish (MMPluginManager *self, + GAsyncResult *result, + GError **error) { g_return_val_if_fail (MM_IS_PLUGIN_MANAGER (self), NULL); g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL); @@ -425,15 +430,15 @@ mm_plugin_manager_find_port_support_finish (MMPluginManager *self, return g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)); } -void -mm_plugin_manager_find_port_support (MMPluginManager *self, - const gchar *subsys, - const gchar *name, - const gchar *physdev_path, - MMPlugin *suggested_plugin, - MMBaseModem *existing, - GAsyncReadyCallback callback, - gpointer user_data) +static void +find_port_support (MMPluginManager *self, + const gchar *subsys, + const gchar *name, + const gchar *physdev_path, + MMPlugin *suggested_plugin, + MMBaseModem *existing, + GAsyncReadyCallback callback, + gpointer user_data) { SupportsInfo *info; @@ -451,7 +456,7 @@ mm_plugin_manager_find_port_support (MMPluginManager *self, info->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, - NULL); + find_port_support); /* Set first plugin to check */ info->current = self->priv->plugins; @@ -542,7 +547,7 @@ find_port_support_ready (MMPluginManager *self, GError *error = NULL; MMPlugin *best_plugin; - best_plugin = mm_plugin_manager_find_port_support_finish (self, result, &error); + best_plugin = find_port_support_finish (self, result, &error); if (!best_plugin) { if (error) { mm_warn ("(%s/%s): error checking support: '%s'", @@ -614,7 +619,7 @@ device_port_grabbed_cb (MMDevice *device, ctx->running_probes = g_list_prepend (ctx->running_probes, port_probe_ctx); /* Launch supports check in the Plugin Manager */ - mm_plugin_manager_find_port_support ( + find_port_support ( ctx->self, g_udev_device_get_subsystem (port_probe_ctx->port), g_udev_device_get_name (port_probe_ctx->port), diff --git a/src/mm-plugin-manager.h b/src/mm-plugin-manager.h index fd96086a..6c2d61ea 100644 --- a/src/mm-plugin-manager.h +++ b/src/mm-plugin-manager.h @@ -58,18 +58,4 @@ gboolean mm_plugin_manager_find_device_support_finish (MMPluginManager *self, GAsyncResult *result, GError **error); -/* Asynchronous operation to find the best plugin giving support to a - * given port. */ -void mm_plugin_manager_find_port_support (MMPluginManager *self, - const gchar *subsys, - const gchar *name, - const gchar *physdev_path, - MMPlugin *suggested_plugin, - MMBaseModem *existing, - GAsyncReadyCallback callback, - gpointer user_data); -MMPlugin *mm_plugin_manager_find_port_support_finish (MMPluginManager *self, - GAsyncResult *result, - GError **error); - #endif /* MM_PLUGIN_MANAGER_H */ |