diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-02-08 19:20:49 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-02-08 20:49:55 +0100 |
commit | 2801fb42fd585bb82a54c053d5a27f62e8df9dfe (patch) | |
tree | 21cae4c891738d9474b50a225757662a8e51c915 | |
parent | 7f947e536a8b4b23a64346dee198b5a659450142 (diff) | |
download | external_libqmi-2801fb42fd585bb82a54c053d5a27f62e8df9dfe.zip external_libqmi-2801fb42fd585bb82a54c053d5a27f62e8df9dfe.tar.gz external_libqmi-2801fb42fd585bb82a54c053d5a27f62e8df9dfe.tar.bz2 |
libqmi-glib,device: ignore driver checking when no-file-check is set
E.g. during the test fixtures in the unit tests, where we create
QmiDevices for non-existent devices.
-rw-r--r-- | src/libqmi-glib/qmi-device.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c index 16be3cc..f01406a 100644 --- a/src/libqmi-glib/qmi-device.c +++ b/src/libqmi-glib/qmi-device.c @@ -2370,6 +2370,8 @@ device_open_context_step (DeviceOpenContext *ctx) ctx->driver = __qmi_utils_get_driver (ctx->self->priv->path); if (ctx->driver) g_debug ("[%s] loaded driver of cdc-wdm port: %s", ctx->self->priv->path_display, ctx->driver); + else if (!ctx->self->priv->no_file_check) + g_warning ("[%s] couldn't load driver of cdc-wdm port", ctx->self->priv->path_display); #if defined MBIM_QMUX_ENABLED @@ -2394,7 +2396,7 @@ device_open_context_step (DeviceOpenContext *ctx) /* MBIM mode requested? */ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM) { - if (!g_str_equal (ctx->driver, "cdc_mbim")) + if (g_strcmp0 (ctx->driver, "cdc_mbim")) g_warning ("[%s] requested MBIM mode but unexpected driver found: %s", ctx->self->priv->path_display, ctx->driver); goto next_step; } @@ -2408,8 +2410,9 @@ device_open_context_step (DeviceOpenContext *ctx) #endif /* MBIM_QMUX_ENABLED */ /* QMI mode requested? */ - if (!g_str_equal (ctx->driver, "qmi_wwan")) - g_warning ("[%s] requested QMI mode but unexpected driver found: %s", ctx->self->priv->path_display, ctx->driver); + if (g_strcmp0 (ctx->driver, "qmi_wwan") && !ctx->self->priv->no_file_check) + g_warning ("[%s] requested QMI mode but unexpected driver found: %s", + ctx->self->priv->path_display, ctx->driver ? ctx->driver : "unknown"); next_step: ctx->step++; |