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.
This commit is contained in:
Aleksander Morgado
2012-09-19 10:18:18 +02:00
parent ee099fcd08
commit c4b5293669

View File

@@ -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)) {