diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-19 10:18:18 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-09-19 10:18:44 +0200 |
commit | c4b5293669f5b956e47a8b0fbfe70d179c0ef43f (patch) | |
tree | 714482581a1c803087982879b6278affffce5ab8 /src | |
parent | ee099fcd087c0960e4b6f40b251e798e53978edf (diff) |
device: if failed to get VID/PID in first port, try the next one
Don't rely only in the first grabbed port to get VID/PID. Some modems, e.g.
Huawei E367, won't report a proper VID in the cdc-wdm port, which is the first
one probed.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mm-device.c b/src/mm-device.c index 83b23867..d7ff1fb0 100644 --- a/src/mm-device.c +++ b/src/mm-device.c @@ -267,8 +267,10 @@ mm_device_grab_port (MMDevice *self, if (mm_device_owns_port (self, udev_port)) return; - /* Get the vendor/product IDs out of the first port grabbed */ - if (!self->priv->port_probes) { + /* Get the vendor/product IDs out of the first one that gives us + * some valid value (it seems we may get NULL reported for VID in QMI + * ports, e.g. Huawei E367) */ + if (!self->priv->vendor && !self->priv->product) { if (!get_device_ids (udev_port, &self->priv->vendor, &self->priv->product)) { |