public inbox for ofono@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [PATCH v2 1/6] qmi: gprs: register to NAS indications earlier
Date: Wed,  1 May 2024 18:21:28 -0500	[thread overview]
Message-ID: <20240501232144.14025-1-denkenz@gmail.com> (raw)

We can register to NAS indications much earlier, as soon as the NAS
service handle is created.  Since the handle is now a 'lightweight'
handle, all service registrations are automatically unregistered when
the handle is destroyed.  There's no need to track the registered
indication id and to remove it separately.
---
 drivers/qmimodem/gprs.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
index 738271905848..bca1897ea02f 100644
--- a/drivers/qmimodem/gprs.c
+++ b/drivers/qmimodem/gprs.c
@@ -39,7 +39,6 @@ struct gprs_data {
 	struct qmi_service *nas;
 	struct qmi_service *wds;
 	unsigned int default_profile;
-	uint16_t serving_system_indication_id;
 };
 
 static bool extract_ss_info(struct qmi_result *result, int *status, int *tech)
@@ -306,10 +305,6 @@ static void get_default_profile_cb(struct qmi_result *result, void *user_data)
 	 */
 	qmi_service_send(data->nas, QMI_NAS_GET_SERVING_SYSTEM, NULL,
 					ss_info_notify, gprs, NULL);
-	data->serving_system_indication_id =
-		qmi_service_register(data->nas,
-					QMI_NAS_SERVING_SYSTEM_INDICATION,
-					ss_info_notify, gprs, NULL);
 
 	ofono_gprs_register(gprs);
 	return;
@@ -369,6 +364,8 @@ static void create_nas_cb(struct qmi_service *service, void *user_data)
 	}
 
 	data->nas = service;
+	qmi_service_register(data->nas, QMI_NAS_SERVING_SYSTEM_INDICATION,
+					ss_info_notify, gprs, NULL);
 
 	qmi_service_create_shared(data->dev, QMI_SERVICE_WDS,
 						create_wds_cb, gprs, NULL);
@@ -403,13 +400,6 @@ static void qmi_gprs_remove(struct ofono_gprs *gprs)
 	ofono_gprs_set_data(gprs, NULL);
 
 	qmi_service_free(data->wds);
-
-	if (data->serving_system_indication_id) {
-		qmi_service_unregister(data->nas,
-					data->serving_system_indication_id);
-		data->serving_system_indication_id = 0;
-	}
-
 	qmi_service_free(data->nas);
 
 	l_free(data);
-- 
2.44.0


             reply	other threads:[~2024-05-01 23:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01 23:21 Denis Kenzior [this message]
2024-05-01 23:21 ` [PATCH v2 2/6] qmi: gprs: Split out GET_DEFAULT_PROFILE_NUMBER request Denis Kenzior
2024-05-01 23:21 ` [PATCH v2 3/6] qmi: gprs: register and listen to event reports Denis Kenzior
2024-05-01 23:21 ` [PATCH v2 4/6] qmi: gprs: Register for other notifications Denis Kenzior
2024-05-01 23:21 ` [PATCH v2 5/6] qmi: wds: add utility to parse Data System Status tlv Denis Kenzior
2024-05-01 23:21 ` [PATCH v2 6/6] qmi: gprs: Obtain LTE attach parameters after indication Denis Kenzior
2024-05-02 13:50 ` [PATCH v2 1/6] qmi: gprs: register to NAS indications earlier patchwork-bot+ofono

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=20240501232144.14025-1-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