mirror of git://git.sysmocom.de/ofono
rilmodem: Simplify ril_gprs_set_attached
This commit is contained in:
parent
418ca19f25
commit
65398ce382
|
@ -115,24 +115,9 @@ static void ril_gprs_state_change(struct ril_msg *message, gpointer user_data)
|
||||||
ril_gprs_registration_status(gprs, NULL, NULL);
|
ril_gprs_registration_status(gprs, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean ril_gprs_set_attached_cb(gpointer user_data)
|
|
||||||
{
|
|
||||||
struct cb_data *cbd = user_data;
|
|
||||||
ofono_gprs_cb_t cb = cbd->cb;
|
|
||||||
|
|
||||||
DBG("");
|
|
||||||
|
|
||||||
CALLBACK_WITH_SUCCESS(cb, cbd->data);
|
|
||||||
g_free(cbd);
|
|
||||||
|
|
||||||
/* Run once per g_idle_add() call */
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ril_gprs_set_attached(struct ofono_gprs *gprs, int attached,
|
static void ril_gprs_set_attached(struct ofono_gprs *gprs, int attached,
|
||||||
ofono_gprs_cb_t cb, void *data)
|
ofono_gprs_cb_t cb, void *data)
|
||||||
{
|
{
|
||||||
struct cb_data *cbd = cb_data_new(cb, data, NULL);
|
|
||||||
struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);
|
struct ril_gprs_data *gd = ofono_gprs_get_data(gprs);
|
||||||
|
|
||||||
DBG("attached: %d", attached);
|
DBG("attached: %d", attached);
|
||||||
|
@ -149,12 +134,7 @@ static void ril_gprs_set_attached(struct ofono_gprs *gprs, int attached,
|
||||||
* are met.
|
* are met.
|
||||||
*/
|
*/
|
||||||
gd->ofono_attached = attached;
|
gd->ofono_attached = attached;
|
||||||
|
CALLBACK_WITH_SUCCESS(cb, data);
|
||||||
/*
|
|
||||||
* Call from idle loop, so core can set driver_attached before
|
|
||||||
* the callback is invoked.
|
|
||||||
*/
|
|
||||||
g_idle_add(ril_gprs_set_attached_cb, cbd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean ril_get_status_retry(gpointer user_data)
|
static gboolean ril_get_status_retry(gpointer user_data)
|
||||||
|
|
Loading…
Reference in New Issue