summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-09-21 10:11:07 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-09-22 00:07:07 -0500
commit7d7732d63747f742bdf1fcfb0b804515786da58e (patch)
tree8223ebeed4b3b0ce6712b7322c4629cc7908e256
parentf599036ed024e6454b95dfcab0d3ec1c4817ee44 (diff)
downloadofono-7d7732d63747f742bdf1fcfb0b804515786da58e.tar.bz2
Don't treat READY CPIN result differently
-rw-r--r--drivers/atmodem/sim.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c
index 775ce60e..1c668b17 100644
--- a/drivers/atmodem/sim.c
+++ b/drivers/atmodem/sim.c
@@ -402,6 +402,7 @@ static struct {
enum ofono_sim_password_type type;
const char *name;
} const at_sim_name[] = {
+ { OFONO_SIM_PASSWORD_NONE, "READY" },
{ OFONO_SIM_PASSWORD_SIM_PIN, "SIM PIN" },
{ OFONO_SIM_PASSWORD_SIM_PUK, "SIM PUK" },
{ OFONO_SIM_PASSWORD_PHSIM_PIN, "PH-SIM PIN" },
@@ -447,15 +448,13 @@ static void at_cpin_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_result_iter_next_unquoted_string(&iter, &pin_required);
- pin_type = -1;
- if (!strcmp(pin_required, "READY"))
- pin_type = OFONO_SIM_PASSWD_NONE;
- else
- for (i = 0; i < len; i++)
- if (!strcmp(pin_required, at_sim_name[i].name)) {
- pin_type = at_sim_name[i].type;
- break;
- }
+ for (i = 0; i < len; i++) {
+ if (strcmp(pin_required, at_sim_name[i].name))
+ continue;
+
+ pin_type = at_sim_name[i].type;
+ break;
+ }
if (pin_type == OFONO_SIM_PASSWORD_INVALID) {
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);