mirror of git://git.sysmocom.de/ofono
udevng: fix removal of serial devices
Since the merge of udev.c into udevng.c all cleanup function must handle both usb devices and serial devices. Add this distinction to check_remove(), so that is doesn't try to iterate the .serial member as if it were a .devices list.
This commit is contained in:
parent
f9cde76095
commit
92a80db13f
|
@ -1380,12 +1380,20 @@ static gboolean check_remove(gpointer key, gpointer value, gpointer user_data)
|
||||||
const char *devpath = user_data;
|
const char *devpath = user_data;
|
||||||
GSList *list;
|
GSList *list;
|
||||||
|
|
||||||
|
switch (modem->type) {
|
||||||
|
case MODEM_TYPE_USB:
|
||||||
for (list = modem->devices; list; list = list->next) {
|
for (list = modem->devices; list; list = list->next) {
|
||||||
struct device_info *info = list->data;
|
struct device_info *info = list->data;
|
||||||
|
|
||||||
if (g_strcmp0(info->devpath, devpath) == 0)
|
if (g_strcmp0(info->devpath, devpath) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case MODEM_TYPE_SERIAL:
|
||||||
|
if (g_strcmp0(modem->serial->devpath, devpath) == 0)
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue