device: only export modem if it is available
This commit is contained in:
@@ -435,8 +435,14 @@ modem_valid (MMBaseModem *modem,
|
|||||||
/* Modem no longer valid */
|
/* Modem no longer valid */
|
||||||
mm_device_remove_modem (self);
|
mm_device_remove_modem (self);
|
||||||
} else {
|
} else {
|
||||||
/* Modem now valid, export it */
|
/* Modem now valid, export it, but only if we really have it around.
|
||||||
export_modem (self);
|
* It may happen that the initialization sequence fails because the
|
||||||
|
* modem gets disconnected, and in that case we don't really need
|
||||||
|
* to export it */
|
||||||
|
if (self->priv->modem)
|
||||||
|
export_modem (self);
|
||||||
|
else
|
||||||
|
mm_dbg ("Not exporting modem; no longer available");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user