diff mbox series

[4/4] gobi: Fail early if re-tried discovery fails

Message ID 20240222201559.1293947-4-denkenz@gmail.com (mailing list archive)
State Accepted
Commit b95a03190891bb206e863d6034edf2529da0f9f3
Headers show
Series [1/4] qmi: Introduce discover() driver method | expand

Commit Message

Denis Kenzior Feb. 22, 2024, 8:15 p.m. UTC
---
 plugins/gobi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/plugins/gobi.c b/plugins/gobi.c
index c4e63b7b464f..99a7d5564ed8 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -406,11 +406,10 @@  static void discover_cb(void *user_data)
 			data->features |= GOBI_VOICE;
 
 	if (!(data->features & GOBI_DMS)) {
-		if (++data->discover_attempts < 3) {
-			qmi_device_discover(data->device, discover_cb,
-								modem, NULL);
+		if (++data->discover_attempts < 3 &&
+				!qmi_device_discover(data->device, discover_cb,
+								modem, NULL))
 			return;
-		}
 
 		shutdown_device(modem);
 		return;