From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH 14/23] qmi: ussd: Drop use of qmi_service_create_shared
Date: Fri, 7 Jun 2024 17:47:14 -0500 [thread overview]
Message-ID: <20240607224746.903769-14-denkenz@gmail.com> (raw)
In-Reply-To: <20240607224746.903769-1-denkenz@gmail.com>
---
drivers/qmimodem/ussd.c | 41 ++++++++---------------------------------
plugins/gobi.c | 3 ++-
2 files changed, 10 insertions(+), 34 deletions(-)
diff --git a/drivers/qmimodem/ussd.c b/drivers/qmimodem/ussd.c
index ec9b60ff1222..6637ae759c55 100644
--- a/drivers/qmimodem/ussd.c
+++ b/drivers/qmimodem/ussd.c
@@ -145,51 +145,26 @@ error:
ofono_ussd_notify(ussd, OFONO_USSD_STATUS_TERMINATED, 0, NULL, 0);
}
-static void create_voice_cb(struct qmi_service *service, void *user_data)
+static int qmi_ussd_probe(struct ofono_ussd *ussd,
+ unsigned int vendor, void *user_data)
{
- struct ofono_ussd *ussd = user_data;
- struct ussd_data *data = ofono_ussd_get_data(ussd);
+ struct qmi_service *voice = user_data;
+ struct ussd_data *data;
DBG("");
- if (service == NULL) {
- ofono_error("Failed to request Voice service");
- ofono_ussd_remove(ussd);
- return;
- }
-
- if (!qmi_service_get_version(service, &data->major, &data->minor)) {
- ofono_error("Failed to get Voice service version");
- ofono_ussd_remove(ussd);
- return;
- }
-
- data->voice = service;
+ data = l_new(struct ussd_data, 1);
+ data->voice = voice;
+ qmi_service_get_version(data->voice, &data->major, &data->minor);
qmi_service_register(data->voice, QMI_VOICE_USSD_IND,
async_ind, ussd, NULL);
-
qmi_service_register(data->voice, QMI_VOICE_ASYNC_ORIG_USSD,
async_orig_ind, ussd, NULL);
- ofono_ussd_register(ussd);
-}
-
-static int qmi_ussd_probe(struct ofono_ussd *ussd,
- unsigned int vendor, void *user_data)
-{
- struct qmi_device *device = user_data;
- struct ussd_data *data;
-
- DBG("");
-
- data = l_new(struct ussd_data, 1);
ofono_ussd_set_data(ussd, data);
- qmi_service_create_shared(device, QMI_SERVICE_VOICE,
- create_voice_cb, ussd, NULL);
-
return 0;
}
@@ -202,7 +177,6 @@ static void qmi_ussd_remove(struct ofono_ussd *ussd)
ofono_ussd_set_data(ussd, NULL);
qmi_service_free(data->voice);
-
l_free(data);
}
@@ -298,6 +272,7 @@ error:
}
static const struct ofono_ussd_driver driver = {
+ .flags = OFONO_ATOM_DRIVER_FLAG_REGISTER_ON_PROBE,
.probe = qmi_ussd_probe,
.remove = qmi_ussd_remove,
.request = qmi_ussd_request,
diff --git a/plugins/gobi.c b/plugins/gobi.c
index 4de5a915ba54..6dee928acdea 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -845,7 +845,8 @@ static void gobi_post_online(struct ofono_modem *modem)
}
if (data->features & GOBI_VOICE) {
- ofono_ussd_create(modem, 0, "qmimodem", data->device);
+ ofono_ussd_create(modem, 0, "qmimodem",
+ qmi_service_clone(data->voice));
ofono_call_settings_create(modem, 0, "qmimodem",
qmi_service_clone(data->voice));
ofono_call_barring_create(modem, 0, "qmimodem",
--
2.45.0
next prev parent reply other threads:[~2024-06-07 22:48 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 22:47 [PATCH 01/23] gobi: Remove phonebook and stk atom creation Denis Kenzior
2024-06-07 22:47 ` [PATCH 02/23] qmi: lookup shared family directly by type Denis Kenzior
2024-06-07 22:47 ` [PATCH 03/23] core: allow multiple args in atom constructors Denis Kenzior
2024-06-07 22:47 ` [PATCH 04/23] unit: Update unit tests to the new API Denis Kenzior
2024-06-07 22:47 ` [PATCH 05/23] core: Support register on probe flag Denis Kenzior
2024-06-07 22:47 ` [PATCH 06/23] qmi: introduce qmi_service_clone Denis Kenzior
2024-06-07 22:47 ` [PATCH 07/23] gobi: request needed services at .enable() Denis Kenzior
2024-06-07 22:47 ` [PATCH 08/23] qmi: devinfo: Drop use of qmi_service_create_shared Denis Kenzior
2024-06-07 22:47 ` [PATCH 09/23] qmi: sim-legacy: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 10/23] qmi: voicecall: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 11/23] qmi: call-barring: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 12/23] qmi: call-forwarding: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 13/23] qmi: call-settings: " Denis Kenzior
2024-06-07 22:47 ` Denis Kenzior [this message]
2024-06-07 22:47 ` [PATCH 15/23] qmi: location-reporting: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 16/23] qmi: sms: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 17/23] qmi: netreg: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 18/23] qmi: netmon: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 19/23] qmi: lte: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 20/23] qmi: gprs-context: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 21/23] qmi: sim: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 22/23] qmi: gprs: " Denis Kenzior
2024-06-07 22:47 ` [PATCH 23/23] qmi: radio-settings: " Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240607224746.903769-14-denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox