port-probe: explicitly report GPS port type if port flagged
And remove all custom logic from all plugins that were doing just that.
This commit is contained in:
committed by
Dan Williams
parent
9c0a557f91
commit
86f840d97b
@@ -65,33 +65,6 @@ create_modem (MMPlugin *self,
|
||||
product));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
grab_port (MMPlugin *self,
|
||||
MMBaseModem *modem,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
MMPortSerialAtFlag pflags = MM_PORT_SERIAL_AT_FLAG_NONE;
|
||||
MMKernelDevice *port;
|
||||
MMPortType port_type;
|
||||
|
||||
port_type = mm_port_probe_get_port_type (probe);
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
|
||||
if (mm_kernel_device_get_property_as_boolean (port, "ID_MM_PORT_TYPE_GPS")) {
|
||||
mm_dbg ("(%s/%s) Port flagged as GPS",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
port_type = MM_PORT_TYPE_GPS;
|
||||
}
|
||||
|
||||
return mm_base_modem_grab_port (modem,
|
||||
port,
|
||||
port_type,
|
||||
pflags,
|
||||
error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
G_MODULE_EXPORT MMPlugin *
|
||||
@@ -124,6 +97,4 @@ mm_plugin_mbm_class_init (MMPluginMbmClass *klass)
|
||||
MMPluginClass *plugin_class = MM_PLUGIN_CLASS (klass);
|
||||
|
||||
plugin_class->create_modem = create_modem;
|
||||
plugin_class->grab_port = grab_port;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user