Skip to contentSkip to conversation

qmimodem: Remove the create exclusive service API

PATCH Applied Denis Kenzior 2 participants 2 messages May 30, 2024 – May 31, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qmimodem: Remove the create exclusive service API

From: Steve Schrock <[email protected]>

qmi_service_create and qmi_service_create_shared were doing the same thing--creating shared services. This change eliminates qmi_service_create to avoid misleading the reader. Exclusive services will be necessary, but they are going to be implemented differently.

---
 drivers/qmimodem/location-reporting.c |  3 ++-
 drivers/qmimodem/qmi.c                |  8 --------
 drivers/qmimodem/qmi.h                |  3 ---
 drivers/qmimodem/sim.c                |  4 ++--
 drivers/qmimodem/sms.c                |  3 ++-
 drivers/qmimodem/voicecall.c          |  2 +-
 plugins/gobi.c                        |  2 +-
 unit/test-qmimodem-qmi.c              | 12 ++++++------
 8 files changed, 14 insertions(+), 23 deletions(-)
drivers/qmimodem/location-reporting.c +2 -1
index e83fd10eae5d..2bde369b46b8 100644
@@ -244,7 +244,8 @@ static int qmi_location_reporting_probe(struct ofono_location_reporting *lr,
 
 	ofono_location_reporting_set_data(lr, data);
 
-	qmi_service_create(device, QMI_SERVICE_PDS, create_pds_cb, lr, NULL);
+	qmi_service_create_shared(device, QMI_SERVICE_PDS, create_pds_cb, lr,
+					NULL);
 
 	return 0;
 }
drivers/qmimodem/qmi.c +0 -8
index 5b016f2d1227..fc43500fae0b 100644
@@ -2712,14 +2712,6 @@ bool qmi_service_create_shared(struct qmi_device *device, uint16_t type,
 	return true;
 }
 
-bool qmi_service_create(struct qmi_device *device,
-				uint16_t type, qmi_create_func_t func,
-				void *user_data, qmi_destroy_func_t destroy)
-{
-	return qmi_service_create_shared(device, type, func,
-						user_data, destroy);
-}
-
 const char *qmi_service_get_identifier(struct qmi_service *service)
 {
 	if (!service)
drivers/qmimodem/qmi.h +0 -3
index 0075f73803cc..802cb065b5fb 100644
@@ -150,9 +150,6 @@ typedef void (*qmi_result_func_t)(struct qmi_result *result, void *user_data);
 
 typedef void (*qmi_create_func_t)(struct qmi_service *service, void *user_data);
 
-bool qmi_service_create(struct qmi_device *device,
-				uint16_t type, qmi_create_func_t func,
-				void *user_data, qmi_destroy_func_t destroy);
 bool qmi_service_create_shared(struct qmi_device *device,
 				uint16_t type, qmi_create_func_t func,
 				void *user_data, qmi_destroy_func_t destroy);
drivers/qmimodem/sim.c +2 -2
index 4137a432d3d2..03be5c8f2ef8 100644
@@ -896,8 +896,8 @@ static void create_dms_cb(struct qmi_service *service, void *user_data)
 
 	data->dms = service;
 
-	qmi_service_create(data->qmi_dev, QMI_SERVICE_UIM, create_uim_cb, sim,
-					NULL);
+	qmi_service_create_shared(data->qmi_dev, QMI_SERVICE_UIM, create_uim_cb,
+					sim, NULL);
 }
 
 static int qmi_sim_probe(struct ofono_sim *sim,
drivers/qmimodem/sms.c +2 -1
index c6252d9d12cb..97e0862d6f23 100644
@@ -788,7 +788,8 @@ static int qmi_sms_probe(struct ofono_sms *sms,
 
 	ofono_sms_set_data(sms, data);
 
-	qmi_service_create(device, QMI_SERVICE_WMS, create_wms_cb, sms, NULL);
+	qmi_service_create_shared(device, QMI_SERVICE_WMS, create_wms_cb, sms,
+					NULL);
 
 	return 0;
 }
drivers/qmimodem/voicecall.c +1 -1
index c6383a563b6e..f4ca2e96f59a 100644
@@ -763,7 +763,7 @@ static int qmi_voicecall_probe(struct ofono_voicecall *vc,
 
 	ofono_voicecall_set_data(vc, data);
 
-	qmi_service_create(device, QMI_SERVICE_VOICE,
+	qmi_service_create_shared(device, QMI_SERVICE_VOICE,
 					create_voice_cb, vc, NULL);
 
 	return 0;
plugins/gobi.c +1 -1
index bb4560c43a06..c9db6704dce0 100644
@@ -405,7 +405,7 @@ static void create_dms_cb(struct qmi_service *service, void *user_data)
 
 	data->dms = service;
 
-	if (qmi_service_create(data->device, QMI_SERVICE_WDA,
+	if (qmi_service_create_shared(data->device, QMI_SERVICE_WDA,
 					create_wda_cb, modem, NULL))
 		return;
 
unit/test-qmimodem-qmi.c +6 -6
index 00bd135683cd..c7db6a053ef5 100644
@@ -246,7 +246,7 @@ static void test_create_services(const void *data)
 		uint16_t major, minor;
 
 		service_type = unique_service_type(i);
-		assert(qmi_service_create(info->device, service_type,
+		assert(qmi_service_create_shared(info->device, service_type,
 						create_service_cb, info, NULL));
 		perform_all_pending_work();
 
@@ -266,7 +266,7 @@ static void test_create_services(const void *data)
 	 * call the callback.
 	 */
 	service_type = unique_service_type(TEST_SERVICE_COUNT);
-	assert(!qmi_service_create(info->device, service_type,
+	assert(!qmi_service_create_shared(info->device, service_type,
 					create_service_cb, info, NULL));
 	perform_all_pending_work();
 	assert(l_queue_isempty(info->services));
@@ -275,7 +275,7 @@ static void test_create_services(const void *data)
 	service_type = unique_service_type(0);
 
 	for (i = 0; i < L_ARRAY_SIZE(services); i++) {
-		assert(qmi_service_create(info->device, service_type,
+		assert(qmi_service_create_shared(info->device, service_type,
 						create_service_cb, info, NULL));
 		perform_all_pending_work();
 
@@ -455,7 +455,7 @@ static void test_send_data(const void *data)
 	perform_discovery(info);
 
 	service_type = unique_service_type(0); /* Use the first service */
-	assert(qmi_service_create(info->device, service_type,
+	assert(qmi_service_create_shared(info->device, service_type,
 					create_service_cb, info, NULL));
 	perform_all_pending_work();
 	service = l_queue_pop_head(info->services);
@@ -505,7 +505,7 @@ static void test_notifications(const void *data)
 	perform_discovery(info);
 
 	service_type = unique_service_type(0); /* Use the first service */
-	assert(qmi_service_create(info->device, service_type,
+	assert(qmi_service_create_shared(info->device, service_type,
 					create_service_cb, info, NULL));
 	perform_all_pending_work();
 	service = l_queue_pop_head(info->services);
@@ -567,7 +567,7 @@ static void test_service_notification_independence(const void *data)
 	l_io_set_read_handler(io, received_data, info, NULL);
 
 	for (i = 0; i < L_ARRAY_SIZE(services); i++) {
-		assert(qmi_service_create(info->device, service_type,
+		assert(qmi_service_create_shared(info->device, service_type,
 						create_service_cb, info, NULL));
 		perform_all_pending_work();
 		services[i] = l_queue_pop_head(info->services);
Signature · 1 line
2.45.0
#1 lore raw
This patch was applied to ofono.git (master) by Denis Kenzior <[email protected]>:

Hello:

This patch was applied to ofono.git (master)
by Denis Kenzior <[email protected]>:

Quoted 9 lines · On Thu, 30 May 2024 09:42:34 -0500 you wrote:

From: Steve Schrock <[email protected]>

qmi_service_create and qmi_service_create_shared were doing the same thing--creating shared services. This change eliminates qmi_service_create to avoid misleading the reader. Exclusive services will be necessary, but they are going to be implemented differently.

[...]

Here is the summary with links:
- qmimodem: Remove the create exclusive service API

    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=73e37c80e8f0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html