if (element->driver && element->driver->enable) {
DBG("Calling enable callback");
- element->driver->enable(element);
+ if (element->driver->enable(element) < 0)
+ return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
element->enabled = TRUE;
if (element->driver && element->driver->disable) {
DBG("Calling disable callback");
- element->driver->disable(element);
+ if (element->driver->disable(element) < 0)
+ return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
element->enabled = FALSE;