From 4b39cb4e0c353f91ec03cc9458f17f6299efd147 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 20 Dec 2011 17:55:10 +0100 Subject: [PATCH] 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. --- plugins/ofono.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/plugins/ofono.c b/plugins/ofono.c index 037524a..87b83c2 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, -- 2.7.4