summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/atmodem/sim-poll.c4
-rw-r--r--include/sim.h8
-rw-r--r--src/modem.c6
-rw-r--r--src/sim.c14
-rw-r--r--src/voicecall.c4
5 files changed, 18 insertions, 18 deletions
diff --git a/drivers/atmodem/sim-poll.c b/drivers/atmodem/sim-poll.c
index 3f1a355c..ae1b55c3 100644
--- a/drivers/atmodem/sim-poll.c
+++ b/drivers/atmodem/sim-poll.c
@@ -168,7 +168,7 @@ static gboolean sim_status_poll(gpointer user_data)
return FALSE;
}
-static void sim_state_watch(void *user, enum ofono_sim_state new_state)
+static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct sim_poll_data *spd = user;
@@ -189,7 +189,7 @@ static void sim_watch(struct ofono_atom *atom,
spd->sim_state_watch = ofono_sim_add_state_watch(spd->sim,
sim_state_watch, spd, NULL);
- sim_state_watch(spd, ofono_sim_get_state(spd->sim));
+ sim_state_watch(ofono_sim_get_state(spd->sim), spd);
sim_status_poll(spd);
diff --git a/include/sim.h b/include/sim.h
index 36a99b93..5bd1dd33 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -94,8 +94,8 @@ typedef void (*ofono_sim_write_cb_t)(const struct ofono_error *error,
typedef void (*ofono_sim_imsi_cb_t)(const struct ofono_error *error,
const char *imsi, void *data);
-typedef void (*ofono_sim_state_event_notify_cb_t)(void *data,
- enum ofono_sim_state new_state);
+typedef void (*ofono_sim_state_event_cb_t)(enum ofono_sim_state new_state,
+ void *data);
typedef void (*ofono_sim_file_read_cb_t)(int ok, int total_length, int record,
const unsigned char *data,
@@ -178,8 +178,8 @@ enum ofono_sim_cphs_phase ofono_sim_get_cphs_phase(struct ofono_sim *sim);
const unsigned char *ofono_sim_get_cphs_service_table(struct ofono_sim *sim);
unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim,
- ofono_sim_state_event_notify_cb_t cb,
- void *data, ofono_destroy_func destroy);
+ ofono_sim_state_event_cb_t cb,
+ void *data, ofono_destroy_func destroy);
void ofono_sim_remove_state_watch(struct ofono_sim *sim, unsigned int id);
diff --git a/src/modem.c b/src/modem.c
index 88ab4510..ed75f6a9 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -1322,7 +1322,7 @@ static void emit_modems()
g_free(modems);
}
-static void modem_sim_ready(void *user, enum ofono_sim_state new_state)
+static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct ofono_modem *modem = user;
@@ -1358,8 +1358,8 @@ static void sim_watch(struct ofono_atom *atom,
modem->sim = __ofono_atom_get_data(atom);
modem->sim_ready_watch = ofono_sim_add_state_watch(modem->sim,
- modem_sim_ready,
- modem, NULL);
+ sim_state_watch,
+ modem, NULL);
}
int ofono_modem_register(struct ofono_modem *modem)
diff --git a/src/sim.c b/src/sim.c
index f8884a2a..fd9b4126 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1001,7 +1001,7 @@ static void sim_efimg_read_cb(int ok, int length, int record,
memcpy(efimg, &data[1], 9);
}
-static void sim_ready(void *user, enum ofono_sim_state new_state)
+static void sim_ready(enum ofono_sim_state new_state, void *user)
{
struct ofono_sim *sim = user;
@@ -2056,7 +2056,7 @@ static void sim_free_state(struct ofono_sim *sim)
void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
{
- ofono_sim_state_event_notify_cb_t notify;
+ ofono_sim_state_event_cb_t notify;
GSList *l;
if (inserted == TRUE && sim->state == OFONO_SIM_STATE_NOT_PRESENT)
@@ -2075,7 +2075,7 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
struct ofono_watchlist_item *item = l->data;
notify = item->notify;
- notify(item->notify_data, sim->state);
+ notify(sim->state, item->notify_data);
}
if (inserted)
@@ -2085,8 +2085,8 @@ void ofono_sim_inserted_notify(struct ofono_sim *sim, ofono_bool_t inserted)
}
unsigned int ofono_sim_add_state_watch(struct ofono_sim *sim,
- ofono_sim_state_event_notify_cb_t notify,
- void *data, ofono_destroy_func destroy)
+ ofono_sim_state_event_cb_t notify,
+ void *data, ofono_destroy_func destroy)
{
struct ofono_watchlist_item *item;
@@ -2123,7 +2123,7 @@ enum ofono_sim_state ofono_sim_get_state(struct ofono_sim *sim)
static void sim_set_ready(struct ofono_sim *sim)
{
GSList *l;
- ofono_sim_state_event_notify_cb_t notify;
+ ofono_sim_state_event_cb_t notify;
if (sim == NULL)
return;
@@ -2137,7 +2137,7 @@ static void sim_set_ready(struct ofono_sim *sim)
struct ofono_watchlist_item *item = l->data;
notify = item->notify;
- notify(item->notify_data, sim->state);
+ notify(sim->state, item->notify_data);
}
}
diff --git a/src/voicecall.c b/src/voicecall.c
index 11dc6251..a5ee2ed1 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2034,7 +2034,7 @@ struct ofono_voicecall *ofono_voicecall_create(struct ofono_modem *modem,
return vc;
}
-static void sim_state_watch(void *user, enum ofono_sim_state new_state)
+static void sim_state_watch(enum ofono_sim_state new_state, void *user)
{
struct ofono_voicecall *vc = user;
@@ -2085,7 +2085,7 @@ static void sim_watch(struct ofono_atom *atom,
sim_state_watch,
vc, NULL);
- sim_state_watch(vc, ofono_sim_get_state(sim));
+ sim_state_watch(ofono_sim_get_state(sim), vc);
}
void ofono_voicecall_register(struct ofono_voicecall *vc)