aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2024-04-30 18:11:50 -0500
committerDenis Kenzior <denkenz@gmail.com>2024-05-01 18:18:17 -0500
commitd61fe2752b1fed7badf73a1d37fafb9dc6615e41 (patch)
tree0e0539a9e91ae7d326a63ee48b2214e90ac8ad09
parente41785fbd3976d502b1ab7c40783be69f733e407 (diff)
downloadofono-d61fe2752b1fed7badf73a1d37fafb9dc6615e41.tar.gz
qmi: gprs: register to NAS indications earlier
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.
-rw-r--r--drivers/qmimodem/gprs.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/qmimodem/gprs.c b/drivers/qmimodem/gprs.c
index 738271905..bca1897ea 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);