Skip to contentSkip to conversation

add a common exit function for interfaces when manager_free and manager_destroy function is called

DISCUSSION Li 2 participants 2 messages Jun 3, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Li

#1 lore raw

I regenerated the patch again.
Thank denis for good advice.

Best Regards,

Minjun
-----Original Message-----
From: Kenzior, Denis
Sent: 2009年6月3日 6:38
To: ofono(a)ofono.org
Cc: Li, Minjun
Subject: Re: add a common exit function for interfaces when manager_free and manager_destroy function is called

Hi Minjun,

Quoted 6 lines · Minjun

Hi Folks,
I regenerated the patch.
Because I found that manager_destroy function is lack of some exit function calls comparing to manager_free function, I add a common exit function for interfaces when manager_free and manager_destroy function is called.

In interface_exit: Please remove if (at) block, its pointless.

Please get rid of all mode changes, only submit changes to files that are relevant to the fix.

Get a proper commit message. E.g. put the description in the email into the commit message.

Quoted 2 lines

Best Regards,
Minjun

Regards,
-Denis

From 96939e631f526a2c89cdb95cf5b8e6360ecbd7d3 Mon Sep 17 00:00:00 2001
From: Minjun Li <[email protected]>
Date: Tue, 2 Jun 2009 08:50:35 +0800
Subject: [PATCH] Adding a common exit function for interfaces when manager_free
and manager_destroy function is called because manager_destroy function is lack of some exit function calls comparing to manager_free

---
 drivers/atmodem/atmodem.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)
drivers/atmodem/atmodem.c +15 -11
index 2f1e430..20b95a5 100644
@@ -90,6 +90,19 @@ static void at_destroy(struct at_data *at)
 	g_free(at);
 }
 
+static void interface_exit(struct at_data *at)
+{
+	at_sms_exit(at->modem);
+	at_call_forwarding_exit(at->modem);
+	at_call_settings_exit(at->modem);
+	at_network_registration_exit(at->modem);
+	at_voicecall_exit(at->modem);
+	at_call_meter_exit(at->modem);
+	at_call_barring_exit(at->modem);
+	at_ussd_exit(at->modem);
+	at_sim_exit(at->modem);
+}
+
 static void manager_free(gpointer user)
 {
 	GSList *l;
@@ -102,15 +115,7 @@ static void manager_free(gpointer user)
 	for (l = g_sessions; l; l = l->next) {
 		struct at_data *at = l->data;
 
-		at_sms_exit(at->modem);
-		at_call_forwarding_exit(at->modem);
-		at_call_settings_exit(at->modem);
-		at_network_registration_exit(at->modem);
-		at_voicecall_exit(at->modem);
-		at_call_meter_exit(at->modem);
-		at_call_barring_exit(at->modem);
-		at_ussd_exit(at->modem);
-		at_sim_exit(at->modem);
+		interface_exit(at);
 		ofono_modem_unregister(at->modem);
 
 		at_destroy(at);
@@ -421,8 +426,7 @@ static DBusMessage *manager_destroy(DBusConnection *conn, DBusMessage *msg,
 		if (strcmp(at->modem->path, path))
 			continue;
 
-		at_network_registration_exit(at->modem);
-		at_voicecall_exit(at->modem);
+		interface_exit(at);
 		ofono_modem_unregister(at->modem);
 
 		g_sessions = g_slist_remove(g_sessions, at);
Signature · 1 line
1.6.0.3
#2 lore raw

Hi Minjun,

Quoted 3 lines · Minjun

I regenerated the patch again.
Thank denis for good advice.

Applied (with a reworded commit description) and pushed upstream. Thanks.

Quoted 3 lines

Best Regards,

Minjun

Regards,
-Denis