aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-modem-huawei.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-07-02 13:48:30 -0400
committerDan Williams <dcbw@redhat.com>2009-07-02 13:48:30 -0400
commit52da9990eef279bbc349685a7558d26cf4b7893b (patch)
treef84433872729aafef296eebae46ace57eb9c8d82 /plugins/mm-modem-huawei.c
parent4e7548e496d580f26a763bcdaeca7e7af75d5141 (diff)
plugins: allow plugins to more easily suggest port types
ZTE modems need to use udev rules to assign port type hints, so generalize that and port all the plugins over to suggested port types in the MMModem interface's grab_port() function.
Diffstat (limited to 'plugins/mm-modem-huawei.c')
-rw-r--r--plugins/mm-modem-huawei.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/mm-modem-huawei.c b/plugins/mm-modem-huawei.c
index 43ee34d1..08ba7d84 100644
--- a/plugins/mm-modem-huawei.c
+++ b/plugins/mm-modem-huawei.c
@@ -496,11 +496,11 @@ handle_status_change (MMSerialPort *port,
/*****************************************************************************/
-/* user_data != NULL means the port is a secondary port */
static gboolean
grab_port (MMModem *modem,
const char *subsys,
const char *name,
+ MMPortType suggested_type,
gpointer user_data,
GError **error)
{
@@ -533,16 +533,14 @@ grab_port (MMModem *modem,
if (usbif == 0) {
if (!mm_generic_gsm_get_port (gsm, MM_PORT_TYPE_PRIMARY))
ptype = MM_PORT_TYPE_PRIMARY;
- } else if (user_data) {
+ } else if (suggested_type == MM_PORT_TYPE_SECONDARY) {
if (!mm_generic_gsm_get_port (gsm, MM_PORT_TYPE_SECONDARY))
ptype = MM_PORT_TYPE_SECONDARY;
}
port = mm_generic_gsm_grab_port (gsm, subsys, name, ptype, error);
- if (!port)
- goto out;
- if (MM_IS_SERIAL_PORT (port)) {
+ if (port && MM_IS_SERIAL_PORT (port)) {
g_object_set (G_OBJECT (port), MM_PORT_CARRIER_DETECT, FALSE, NULL);
if (ptype == MM_PORT_TYPE_SECONDARY) {
GRegex *regex;