summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-12-20 17:55:10 +0100
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2011-12-22 11:10:15 +0100
commit4b39cb4e0c353f91ec03cc9458f17f6299efd147 (patch)
treeca1ee0fbf0ed849836245975e1d88e9e784dc8ce /plugins
parent08cf0d0f1c417c1cd66aaddf54116cef52ffffb4 (diff)
downloadconnman-4b39cb4e0c353f91ec03cc9458f17f6299efd147.tar.gz
connman-4b39cb4e0c353f91ec03cc9458f17f6299efd147.tar.bz2
connman-4b39cb4e0c353f91ec03cc9458f17f6299efd147.zip
ofono: Remove unused set_cm_powered
Also follow the patternt that we have only a set function with an argument for the value tos set.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ofono.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 037524ac..87b83c25 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -134,8 +134,6 @@ struct modem_data {
connman_bool_t attached;
connman_bool_t cm_powered;
- connman_bool_t set_cm_powered;
-
/* ConnectionContext Interface */
connman_bool_t active;
connman_bool_t set_active;
@@ -574,33 +572,22 @@ static int modem_set_online(struct modem_data *modem, connman_bool_t online)
NULL);
}
-static void cm_set_powered_reply(struct modem_data *modem,
- connman_bool_t success)
-{
- DBG("%s", modem->path);
-
- if (success == TRUE) {
- /*
- * Don't handle do anything on success here. oFono will send
- * the change via PropertyChanged singal.
- */
- return;
- }
-
- modem->set_cm_powered = FALSE;
-}
-
-static int cm_set_powered(struct modem_data *modem)
+static int cm_set_powered(struct modem_data *modem, connman_bool_t powered)
{
- DBG("%s", modem->path);
+ int err;
- modem->set_cm_powered = TRUE;
+ DBG("%s powered %d", modem->path, powered);
- return set_property(modem, modem->path,
+ err = set_property(modem, modem->path,
OFONO_CM_INTERFACE,
"Powered", DBUS_TYPE_BOOLEAN,
- &modem->set_cm_powered,
- cm_set_powered_reply);
+ &powered,
+ NULL);
+
+ if (powered == FALSE && err == -EINPROGRESS)
+ return 0;
+
+ return err;
}
static int modem_set_powered(struct modem_data *modem)
@@ -1596,7 +1583,7 @@ static void cm_update_powered(struct modem_data *modem,
if (modem->cm_powered == TRUE)
return;
- cm_set_powered(modem);
+ cm_set_powered(modem, TRUE);
}
static gboolean cm_changed(DBusConnection *connection, DBusMessage *message,