diff options
author | Jonas Bonn <jonas@southpole.se> | 2018-04-03 16:50:56 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2018-04-04 10:03:13 -0500 |
commit | 88d9b1a32d4461a0831188cc4c4928480a402013 (patch) | |
tree | 972c05356dd4ee3ad132229254174d142cd0c177 /drivers/qmimodem | |
parent | c0527a211cc1b31d005362af0f6af004b23a1aa1 (diff) | |
download | ofono-88d9b1a32d4461a0831188cc4c4928480a402013.tar.gz |
qmi: make services always shared
Diffstat (limited to 'drivers/qmimodem')
-rw-r--r-- | drivers/qmimodem/qmi.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/qmimodem/qmi.c b/drivers/qmimodem/qmi.c index 0acd1170..19ec1303 100644 --- a/drivers/qmimodem/qmi.c +++ b/drivers/qmimodem/qmi.c @@ -87,7 +87,6 @@ struct qmi_device { struct qmi_service { int ref_count; struct qmi_device *device; - bool shared; uint8_t type; uint16_t major; uint16_t minor; @@ -261,9 +260,6 @@ static gboolean __service_compare_shared(gpointer key, gpointer value, struct qmi_service *service = value; uint8_t type = GPOINTER_TO_UINT(user_data); - if (!service->shared) - return FALSE; - if (service->type == type) return TRUE; @@ -1936,7 +1932,6 @@ bool qmi_result_get_uint64(struct qmi_result *result, uint8_t type, struct service_create_data { struct discovery super; struct qmi_device *device; - bool shared; uint8_t type; uint16_t major; uint16_t minor; @@ -2007,7 +2002,6 @@ static void service_create_callback(uint16_t message, uint16_t length, service->ref_count = 1; service->device = data->device; - service->shared = data->shared; service->type = data->type; service->major = data->major; @@ -2030,7 +2024,7 @@ done: __qmi_device_discovery_complete(data->device, &data->super); } -static bool service_create(struct qmi_device *device, bool shared, +static bool service_create(struct qmi_device *device, uint8_t type, qmi_create_func_t func, void *user_data, qmi_destroy_func_t destroy) { @@ -2048,7 +2042,6 @@ static bool service_create(struct qmi_device *device, bool shared, data->super.destroy = service_create_data_free; data->device = device; - data->shared = shared; data->type = type; data->func = func; data->user_data = user_data; @@ -2077,19 +2070,6 @@ static bool service_create(struct qmi_device *device, bool shared, return true; } -bool qmi_service_create(struct qmi_device *device, - uint8_t type, qmi_create_func_t func, - void *user_data, qmi_destroy_func_t destroy) -{ - if (!device || !func) - return false; - - if (type == QMI_SERVICE_CONTROL) - return false; - - return service_create(device, false, type, func, user_data, destroy); -} - struct service_create_shared_data { struct discovery super; struct qmi_service *service; @@ -2165,7 +2145,15 @@ bool qmi_service_create_shared(struct qmi_device *device, return 0; } - return service_create(device, true, type, func, user_data, destroy); + return service_create(device, type, func, user_data, destroy); +} + +bool qmi_service_create(struct qmi_device *device, + uint8_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); } static void service_release_callback(uint16_t message, uint16_t length, |