All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/6] Don't remove atoms when state goes from INSERTED to NOT PRESENT.
@ 2010-05-07  0:26 Andrzej Zaborowski
  2010-05-10 20:28 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Zaborowski @ 2010-05-07  0:26 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

---
 src/modem.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/modem.c b/src/modem.c
index 8319702..0d0cb2a 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -1132,13 +1132,16 @@ static void modem_sim_ready(void *user, enum ofono_sim_state new_state)
 
 	switch (new_state) {
 	case OFONO_SIM_STATE_NOT_PRESENT:
-		remove_all_atoms(&modem->atoms);
+		if (modem->pre_sim_atoms != NULL)
+			remove_all_atoms(&modem->atoms);
 		break;
 	case OFONO_SIM_STATE_INSERTED:
 		break;
 	case OFONO_SIM_STATE_READY:
-		modem->pre_sim_atoms = modem->atoms;
-		modem->atoms = NULL;
+		if (modem->pre_sim_atoms == NULL) {
+			modem->pre_sim_atoms = modem->atoms;
+			modem->atoms = NULL;
+		}
 
 		if (modem->driver->post_sim)
 			modem->driver->post_sim(modem);
-- 
1.6.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 1/6] Don't remove atoms when state goes from INSERTED to NOT PRESENT.
  2010-05-07  0:26 [PATCH v2 1/6] Don't remove atoms when state goes from INSERTED to NOT PRESENT Andrzej Zaborowski
@ 2010-05-10 20:28 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-05-10 20:28 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

Hi Andrew,

> ---
>  src/modem.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/modem.c b/src/modem.c
> index 8319702..0d0cb2a 100644

Patch has been applied with a modified description.  However, I'm thinking we 
should manipulate the lists directly based on SIM presence / pin state inside 
ofono_modem_add_atom.  The logic is a little too complicated now.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-10 20:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07  0:26 [PATCH v2 1/6] Don't remove atoms when state goes from INSERTED to NOT PRESENT Andrzej Zaborowski
2010-05-10 20:28 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.