udev: fixes for detection of non-USB modems

This patch fixes up some fallout from the merging of the udev and udevng
modules.

i)  The 'serial' modems in question are not necessarily serial modems at
all; for example, the N900 ISI modems appear as network devices and don't
have a devnode.  This patch relaxes the requirement that a devnode exist.

ii)  The modem driver was being set to 'legacy', which is a remnant of
an earlier approach to merging these modules.  The driver needs to be
properly set to the value of the OFONO_DRIVER property in order for the
setup function to be found.

iii)  The serial modem's private data was being added to the modem
structure incorrectly...

In particular point iii) above shows that there is essentially nobody
using these devices which makes modifications in this area tricky.
This commit is contained in:
Jonas Bonn 2017-09-12 10:11:19 +02:00 committed by Denis Kenzior
parent a18c892c64
commit 29c5cd238b
1 changed files with 3 additions and 3 deletions

View File

@ -1325,7 +1325,7 @@ static void add_serial_device(struct udev_device *dev)
devnode = udev_device_get_devnode(dev);
if (!syspath || !devname || !devpath || !devnode)
if (!syspath || !devpath)
return;
modem = g_hash_table_lookup(modem_list, syspath);
@ -1337,7 +1337,7 @@ static void add_serial_device(struct udev_device *dev)
modem->type = MODEM_TYPE_SERIAL;
modem->syspath = g_strdup(syspath);
modem->devname = g_strdup(devname);
modem->driver = g_strdup("legacy");
modem->driver = g_strdup(driver);
g_hash_table_replace(modem_list, modem->syspath, modem);
}
@ -1357,7 +1357,7 @@ static void add_serial_device(struct udev_device *dev)
info->subsystem = g_strdup(subsystem);
info->dev = udev_device_ref(dev);
modem->devices = g_slist_append(modem->devices, info);
modem->serial = info;
}
static void add_device(const char *syspath, const char *devname,