1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.
Change-Id: Ic28e18d4f09a2b3a89517db25498c7b8c191a61f
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
scenarios->num = SCENARIO_MAX;
scenarios->list = malloc(sizeof(struct scenario)*scenarios->num);
if (!scenarios->list) {
- _E("failed to allocat memory for scenario");
+ _E("Failed to allocat memory for scenario.");
return -errno;
}
}
if (MATCH(result->section, "PmqosScenario")) {
ret = pmqos_parse_scenario(result, user_data);
if (ret < 0)
- _E("failed to parse [PmqosScenario] section : %d", ret);
+ _E("Failed to parse 'PmqosScenario' section: %d", ret);
return ret;
}
if (MATCH(result->section, name)) {
ret = pmqos_parse_each_scenario(result, user_data, index);
if (ret < 0)
- _E("failed to parse [Scenario%d] section : %d", index, ret);
+ _E("Failed to parse 'Scenario%d' section: %d", index, ret);
return ret;
}
}
/* get configuration file */
ret = config_parse(path, pmqos_load_config, scenarios);
if (ret < 0) {
- _E("failed to load conficuration file(%s) : %d", path, ret);
+ _E("Failed to load conficuration file(%s): %d", path, ret);
release_pmqos_table(scenarios);
return ret;
}
if (!cpu_dev ||
!cpu_dev->start_boost ||
!cpu_dev->stop_boost) {
- _E("cpu device HAL does not exist");
+ _E("Cpu device HAL does not exist.");
return -ENODEV;
}
return -EINVAL;
if (val) {
- _D("Set pm scenario : [Lock ]%s", name);
+ _D("Set pm scenario. Lock %s.", name);
return cpu_dev->start_boost((void *)name);
}
- _D("Set pm scenario : [Unlock]%s", name);
+ _D("Set pm scenario. Unlock %s.", name);
return cpu_dev->stop_boost((void *)name);
}
clock_gettime(CLOCK_REALTIME, &unlock_timer_start_st);
unlock_timer = g_timeout_add(unlock_timer_owner.timeout, pmqos_cpu_timer, NULL);
if (unlock_timer == 0) {
- _E("fail init pmqos unlock %s %d", cpu->name, cpu->timeout);
+ _E("Failed to init pmqos unlock. name=%s timeout=%d", cpu->name, cpu->timeout);
return -EPERM;
}
break;
ret = pmqos_cpu_cancel(unlock_timer_owner.name);
if (ret < 0)
- _E("Can not find %s request", unlock_timer_owner.name);
+ _E("Can not find %s request.", unlock_timer_owner.name);
unlock_timer = 0;
return G_SOURCE_REMOVE;
/* Check valid parameter */
if (val > DEFAULT_PMQOS_TIMER) {
- _I("The timer value cannot be higher than default time value(%dms)", DEFAULT_PMQOS_TIMER);
+ _I("The timer value cannot be higher than default time value(%dms).", DEFAULT_PMQOS_TIMER);
val = DEFAULT_PMQOS_TIMER;
}
/* allocate dbus methods structure */
methods = malloc(sizeof(dbus_method_s) * scenarios.num);
if (!methods) {
- _E("failed to allocate methods memory : %d", errno);
+ _E("Failed to allocate methods memory: %d", errno);
/* release scenarios memory */
release_pmqos_table(&scenarios);
return -errno;
/* if this scenario does not support */
if (!scenarios.list[i].support) {
- _I("do not support [%s] scenario", scenarios.list[i].name);
+ _I("Do not support '%s' scenario.", scenarios.list[i].name);
continue;
}
methods[i].signature_in = "i";
methods[i].signature_out = "i";
methods[i].func = dbus_pmqos_handler;
- _D("support [%s] scenario", scenarios.list[i].name);
+ _D("Support '%s' scenario.", scenarios.list[i].name);
}
*dbus_methods = methods;
done = *(int *)data;
if (!done)
goto out;
- _I("booting done");
+ _I("Booting done.");
/* register dbus methods */
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_PMQOS, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
/* get methods from config file */
size = get_methods_from_conf(PMQOS_CONF_PATH, &methods);
if (size < 0)
- _E("failed to load configuration file(%s)", PMQOS_CONF_PATH);
+ _E("Failed to load configuration file(%s).", PMQOS_CONF_PATH);
/* register dbus methods for pmqos */
if (methods) {
dbus_interface_conf.nr_methods = size;
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_PMQOS, &dbus_interface_conf);
if (ret < 0)
- _E("fail to init dbus method from conf(%d)", ret);
+ _E("Failed to init dbus method from conf: %d", ret);
free(methods);
}
if (dbus_handle_register_dbus_object_all(NULL) < 0)
- _E("Failed to register dbus method! %d", ret);
+ _E("Failed to register dbus method: %d", ret);
/* register notifier for each event */
register_notifier(DEVICE_NOTIFIER_CPU_BOOST_LOWBAT, pmqos_lowbat);
r = hw_get_info(CPU_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (r < 0) {
- _I("cpu shared library is not supported: %d", r);
+ _I("Cpu shared library is not supported: %d", r);
return -ENODEV;
}
if (!info->open) {
- _E("fail to open cpu device : open(NULL)");
+ _E("Failed to open cpu device: open(NULL)");
return -EPERM;
}
r = info->open(info, NULL, (struct hw_common **)&cpu_dev);
if (r < 0) {
- _E("fail to get cpu device structure : %d", r);
+ _E("Failed to get cpu device structure: %d", r);
return -EPERM;
}
- _D("cpu device structure load success");
+ _D("Cpu device structure load success.");
return 0;
}
if (!args[1])
return -EINVAL;
- printf("start %s device!\n", args[1]);
+ printf("Start %s device.\n", args[1]);
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
devices[arg_id].path,
if (!args[1])
return -EINVAL;
- printf("stop %s device!\n", args[1]);
+ printf("Stop %s device.\n", args[1]);
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
devices[arg_id].path,
if (!args[1] || !args[2] || !args[3])
return -EINVAL;
- printf("%s (%s %s)!\n", args[1], args[2], args[3]);
+ printf("%s (%s %s).\n", args[1], args[2], args[3]);
ret = dbus_handle_method_async_var(DEVICED_BUS_NAME,
devices[arg_id].path,
"Dumpmode",
g_variant_new("(s)", args[3]));
if (ret < 0)
- printf("failed to set dump mode (%d)", ret);
+ printf("Failed to set dump mode: %d", ret);
return ret;
}
if (!args[1])
return -EINVAL;
- printf("save log %s device!\n", args[1]);
+ printf("Save log %s device.\n", args[1]);
ret = dbus_handle_method_async(DEVICED_BUS_NAME,
devices[arg_id].path,
"SaveLog",
NULL, NULL);
if (ret < 0)
- printf("failed to save log (%d)", ret);
+ printf("Failed to save log: %d", ret);
return ret;
}
if (!args[1])
return -EINVAL;
- printf("save dbus name!\n");
+ printf("Save dbus name.\n");
msg = dbus_handle_method_sync_with_reply_var(DBUS_BUS_NAME,
DBUS_OBJECT_PATH,
"ListNames",
NULL);
if (!msg) {
- printf("failed to get list names");
+ printf("Failed to get list names.");
return -EBADMSG;
}
if (!dh_get_param_from_var(msg, "(as)", &iter)) {
- printf("invalid list name arguments!");
+ printf("Invalid list name arguments.");
g_variant_unref(msg);
return -EINVAL;
}
- printf("%" G_GSIZE_FORMAT " connections\n", g_variant_iter_n_children(iter));
+ printf("%" G_GSIZE_FORMAT " connections.\n", g_variant_iter_n_children(iter));
while (g_variant_iter_loop(iter, "s", &str)) {
pid = dbus_handle_get_sender_pid(NULL, str);
if (!args[1])
return -EINVAL;
- printf("print %s to dlog!\n", args[1]);
+ printf("Print %s to dlog.\n", args[1]);
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
devices[arg_id].path,
if (!args[3])
return -EINVAL;
- printf("enable %s device!\n", args[3]);
+ printf("Enable %s device.\n", args[3]);
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
devices[arg_id].path,
if (!args[3])
return -EINVAL;
- printf("disable %s device!\n", args[3]);
+ printf("Disable %s device.\n", args[3]);
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
devices[arg_id].path,
if (!args[1] || !type)
return -EINVAL;
- printf("Power %s device!\n", args[2]);
+ printf("Power %s device.\n", args[2]);
msg = dbus_handle_method_sync_with_reply_var(DEVICED_BUS_NAME,
devices[arg_id].path,
static inline void usage()
{
printf("[usage] devicectl <device_name> <action>\n");
- printf("Please use option --help to check options\n");
+ printf("Please use option --help to check options.\n");
}
static void help()
break;
if (i >= ARRAY_SIZE(devices)) {
- printf("invalid device name! %s\n", argv[1]);
+ printf("Invalid device name. %s\n", argv[1]);
usage();
return -EINVAL;
}
break;
if (i >= ARRAY_SIZE(actions)) {
- printf("invalid action name! %s\n", argv[2]);
+ printf("Invalid action name. %s\n", argv[2]);
usage();
return -EINVAL;
}
if (actions[i].argc != argc) {
- printf("invalid arg count!\n");
+ printf("Invalid arg count.\n");
usage();
return -EINVAL;
}
pid = fork();
if (pid < 0) {
- printf("fork() failed\n");
+ printf("Failed to call fork().\n");
return -ENOMEM;
}
/*child*/
if (execvp(argv[0], argv) < 0)
- printf("execvp failed (%d)\n", errno);
+ printf("Failed to call execvp: %d\n", errno);
return 0;
}
fp = fopen(path, "w");
if (!fp) {
- printf("FAIL: fopen(%s)\n", path);
+ printf("Failed to open '%s'.\n", path);
return -ENOMEM;
}
ret = fwrite(value, sizeof(char), strlen(value), fp);
fclose(fp);
if (ret < strlen(value)) {
- printf("FAIL: fwrite(%s)\n", value);
+ printf("Failed to write '%s'.\n", value);
ret = -ENOMEM;
}
for (i = 0; i < ARRAY_SIZE(usb_confs); i++) {
ret = write_sysfs(usb_confs[i].path, usb_confs[i].value);
if (ret < 0) {
- printf("usb setting fails (%s), (%s)\n", usb_confs[i].path, usb_confs[i].value);
+ printf("Failed to write usb setting. path=%s value=%s\n", usb_confs[i].path, usb_confs[i].value);
return ret;
}
}
int load_usb_mode(char *opt)
{
if (!opt) {
- printf("Failed: Forth parameter is NULL\n");
+ printf("Failed: Forth parameter is NULL.\n");
return -EINVAL;
}
if (!strncmp(opt, USB_SSH, strlen(opt)))
return load_ssh();
- printf("Failed: Forth parameter is invalid (%s)\n", opt);
+ printf("Failed: Forth parameter(%s) is invalid.\n", opt);
return -EINVAL;
}
int unload_usb_mode(char *opt)
{
if (!opt) {
- printf("Failed: Forth parameter is NULL\n");
+ printf("Failed: Forth parameter is NULL.\n");
return -EINVAL;
}
if (!strncmp(opt, USB_SSH, strlen(opt)))
return unload_ssh();
- printf("Failed: Forth parameter is invalid (%s)\n", opt);
+ printf("Failed: Forth parameter(%s) is invalid.\n", opt);
return -EINVAL;
}
if (path)
fp = fopen(fname, "w+");
if (!fp)
- _I("Failed to open %s, print to DLOG", fname);
+ _I("Failed to open '%s', print to DLOG.", fname);
/* save dump each device ops */
DD_LIST_FOREACH(head, elem, dev) {
if (dev->dump) {
- _D("[%s] get dump", dev->name);
+ _D("[%s] Get dump.", dev->name);
LOG_DUMP(fp, "\n==== %s\n\n", dev->name);
dev->dump(fp, mode, dev->dump_data);
}
/* send finish signal to dump service */
send_dump_signal(DUMP_FINISH_SIGNAL);
- _D("%s(%d) dump is saved!", fname, mode);
+ _D("Dump(%s:%d) is saved!", fname, mode);
}
static void dump_signal_handler(GDBusConnection *conn,
char *log_path = NULL;
g_variant_get(param, "(is)", &mode, &log_path);
- _D("mode(%d) path(%s)", mode, log_path);
+ _D("mode=%d path=%s", mode, log_path);
dump_all_devices(mode, log_path);
g_free(log_path);
dump_signal_handler,
NULL, NULL);
if (ret <= 0)
- _E("Failed to register signal handler! %d", ret);
+ _E("Failed to register signal handler: %d", ret);
}
static const struct device_ops dump_device_ops = {
if (old == status)
return;
- _I("broadcast cradle status %d", status);
+ _I("Broadcast cradle status(%d).", status);
old = status;
dbus_handle_broadcast_dbus_signal_var(DEVICED_PATH_SYSNOTI,
static int cradle_update(int status)
{
- _I("jack - cradle changed %d", status);
+ _I("Cradle changed. status=%d", status);
if (disp_plgn.pm_change_internal)
disp_plgn.pm_change_internal(INTERNAL_LOCK_CRADLE, LCD_NORMAL);
cradle_send_broadcast(status);
if (vconf_set_int(VCONFKEY_SYSMAN_CRADLE_STATUS, status) != 0) {
- _E("failed to set vconf status");
+ _E("Failed to set vconf status.");
return -EIO;
}
if (cradle == DOCK_SOUND) {
if (disp_plgn.pm_lock_internal)
disp_plgn.pm_lock_internal(INTERNAL_LOCK_CRADLE, LCD_DIM, STAY_CUR_STATE, 0);
- _I("sound dock is connected! dim lock is on.");
+ _I("Sound dock is connected. Dim lock is on.");
}
return 0;
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_SYSNOTI, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
}
static void cradle_exit(void *data)
if (old == status)
return;
- _I("broadcast earjack status %d", status);
+ _I("Broadcast earjack status(%d).", status);
old = status;
dbus_handle_broadcast_dbus_signal_var(DEVICED_PATH_SYSNOTI,
static int earjack_update(int status)
{
- _I("jack - earjack changed %d", status);
+ _I("Earjack changed. status=%d", status);
vconf_set_int(VCONFKEY_SYSMAN_EARJACK, status);
earjack_send_broadcast(status);
earjack_send_system_event(status);
if (dev->status == status)
return 0;
- _I("Changed %s device : %d -> %d", name, dev->status, status);
+ _I("Changed %s device: %d to %d.", name, dev->status, status);
dev->status = status;
METHOD_SYSPOPUP_SHOW,
g_variant_new("(s)", buf));
if (ret < 0)
- _E("Failed to launch USB restricted popup(%d)", ret);
+ _E("Failed to launch USB restricted popup: %d", ret);
return ret;
} else
return 0;
return -ENODEV;
if (dev->enabled) {
- _I("extcon(%s) already enabled", name);
+ _I("Extcon(%s) already enabled.", name);
return 0;
}
if (strncmp(name, "USB", strlen("USB")) == 0) {
ret = extcon_update("USB", "0");
if (ret != 0)
- _E("fail to disconnect USB");
+ _E("Failed to disconnect USB.");
ret = extcon_update("USB", "1");
if (ret != 0)
- _E("fail to connect USB");
+ _E("Failed to connect USB.");
}
- _I("extcon(%s) enabled", name);
+ _I("Extcon(%s) enabled.", name);
return 0;
}
METHOD_SYSPOPUP_SHOW,
g_variant_new("(s)", buf));
if (ret < 0)
- _E("Failed to launch USB restricted popup(%d)", ret);
+ _E("Failed to launch USB restricted popup: %d", ret);
if (!dev->enabled) {
- _I("extcon(%s) already disabled", name);
+ _I("Extcon(%s) already disabled.", name);
return 0;
}
dev->exit(NULL);
dev->enabled = false;
- _I("extcon(%s) disabled", name);
+ _I("Extcon(%s) disabled.", name);
return 0;
}
ret = extcon_parsing_value(env_value);
if (ret < 0)
- _E("fail to parse extcon value : %d", ret);
+ _E("Failed to parse extcon value: %d", ret);
}
static int extcon_load_uevent(struct parse_result *result, void *user_data)
dir = opendir(EXTCON_PATH);
if (!dir) {
ret = -errno;
- _E("Cannot open dir (%s, errno:%d)", EXTCON_PATH, ret);
+ _E("Cannot open dir(%s): %d", EXTCON_PATH, ret);
return ret;
}
continue;
snprintf(node, sizeof(node), "%s/%s/state",
EXTCON_PATH, result->d_name);
- _I("checking node (%s)", node);
+ _I("Checking node(%s).", node);
if (access(node, F_OK) != 0)
continue;
ret = config_parse(node, extcon_load_uevent, NULL);
if (ret < 0)
- _E("fail to parse %s data : %d", node, ret);
+ _E("Failed to parse %s data: %d", node, ret);
}
if (dir)
dev = find_extcon(str);
if (!dev) {
- _E("fail to matched extcon device : %s", str);
+ _E("Failed to matched extcon(%s) device.", str);
ret = -ENOENT;
goto error;
}
ret = dev->status;
- _D("Extcon device : %s, status : %d", dev->name, dev->status);
+ _D("Extcon(%s) device status=%d", dev->name, dev->status);
error:
g_free(str);
(const struct hw_info **)&info);
if (ret == 0) {
if (!info->open) {
- _E("Failed to open extcon device; open(NULL)");
+ _E("Failed to open extcon device: open(NULL)");
return -ENODEV;
}
ret = info->open(info, NULL, (struct hw_common **)&extcon_dev);
if (ret < 0) {
- _E("Failed to get extcon device structure (%d)", ret);
+ _E("Failed to get extcon device structure: %d", ret);
return ret;
}
- _I("extcon device structure load success");
+ _I("Extcon device structure load success.");
return 0;
}
* deviced does not control extcon devices.
*/
if (access(EXTCON_PATH, R_OK) != 0) {
- _E("there is no extcon class");
+ _E("There is no extcon class.");
return -ENODEV;
}
/* register extcon uevent */
ret = register_kernel_uevent_control(&uh);
if (ret < 0)
- _E("fail to register extcon uevent : %d", ret);
+ _E("Failed to register extcon uevent: %d", ret);
/* load the initialize value by accessing the node directly */
ret = get_extcon_init_state();
if (ret < 0)
- _E("fail to init extcon nodes : %d", ret);
+ _E("Failed to init extcon nodes: %d", ret);
}
}
/* unreigster extcon uevent */
ret = unregister_kernel_uevent_control(&uh);
if (ret < 0)
- _E("fail to unregister extcon uevent : %d", ret);
+ _E("Failed to unregister extcon uevent: %d", ret);
}
}
/* initialize extcon devices */
DD_LIST_FOREACH(extcon_list, l, dev) {
- _I("[extcon] init (%s)", dev->name);
+ _I("Extcon(%s) init.", dev->name);
if (dev->init)
dev->init(data);
dev->enabled = true;
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_EXTCON, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
register_notifier(DEVICE_NOTIFIER_EVENT_HANDLER, event_handler_state_changed);
/* deinitialize extcon devices */
DD_LIST_FOREACH(extcon_list, l, dev) {
- _I("[extcon] deinit (%s)", dev->name);
+ _I("Extcon(%s) deinit.", dev->name);
if (dev->exit)
dev->exit(data);
dev->enabled = false;
if (old == status)
return;
- _I("broadcast hdmi status %d", status);
+ _I("Broadcast hdmi status(%d)", status);
old = status;
dbus_handle_broadcast_dbus_signal_var(DEVICED_PATH_SYSNOTI,
static int hdmi_update(int status)
{
- _I("jack - hdmi changed %d", status);
+ _I("Hdmi changed. status=%d", status);
if (disp_plgn.pm_change_internal)
disp_plgn.pm_change_internal(INTERNAL_LOCK_HDMI, LCD_NORMAL);
vconf_set_int(VCONFKEY_SYSMAN_HDMI, status);
if (hdmi == 0) {
if (disp_plgn.pm_lock_internal)
disp_plgn.pm_lock_internal(INTERNAL_LOCK_HDMI, LCD_DIM, STAY_CUR_STATE, 0);
- _I("hdmi is connected! dim lock is on.");
+ _I("Hdmi is connected. Dim lock is on.");
}
return 0;
}
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_SYSNOTI, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
}
static void hdmi_exit(void *data)
g_variant_iter_free(iter);
- _I("frequency : %d, pattern_size: %d", freq_pattern[0], size);
+ _I("frequency=%d pattern_size=%d", freq_pattern[0], size);
ret = ir_dev->transmit(freq_pattern, size);
{
int ret = -ENOTSUP;
- _E("The method is not supported. Use device_ir_transmit() of capi-system-device");
+ _E("The method is not supported. Use device_ir_transmit() of capi-system-device.");
return g_variant_new("(i)", ret);
}
(const struct hw_info **)&info);
if (ret < 0) {
- _E("Fail to load ir(%d)", ret);
+ _E("Failed to load ir: %d", ret);
return -ENODEV;
}
if (!info->open) {
- _E("Failed to open ir device; open(NULL)");
+ _E("Failed to open ir device: open(NULL)");
return -ENODEV;
}
ret = info->open(info, NULL, (struct hw_common**)&ir_dev);
if (ret < 0) {
- _E("Failed to get ir device structure (%d)", ret);
+ _E("Failed to get ir device structure: %d", ret);
return ret;
}
- _I("ir device structure load success");
+ _I("Ir device structure load success.");
return 0;
}
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_IR, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LED, &dbus_interface_legacy);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
}
int ret_val;
if (noti_h > 0) {
- _D("already ongoing noti show : handle(%d)", noti_h);
+ _D("Already ongoing noti show handle(%d).", noti_h);
return 0;
}
NULL, NULL);
noti_h = ret_val;
- _D("insert noti handle : %d", noti_h);
+ _D("Insert noti handle(%d).", noti_h);
return (ret_val < 0) ? ret_val : 0;
}
int ret_val;
if (noti_h <= 0) {
- _D("already ongoing noti clear");
+ _D("Already ongoing noti clear.");
return 0;
}
METHOD_TORCH_NOTI_OFF,
g_variant_new("(i)", noti_h));
- _D("delete noti handle : %d", noti_h);
+ _D("Delete noti handle(%d).", noti_h);
noti_h = 0;
return ret_val;
}
DD_LIST_FOREACH(rgb_list, l, req) {
if (req->pid == pid) {
- _I("remove rgb play request from pid (%d)", pid);
+ _I("Remove rgb play request from pid(%d).", pid);
if (req == top)
top = NULL;
DD_LIST_REMOVE(rgb_list, req);
if (ret < 0) {
req = calloc(1, sizeof(struct rgb_request));
if (!req) {
- _E("calloc() failed");
+ _E("Failed to call calloc().");
return -ENOMEM;
}
req->pid = pid;
struct led_state off = { 0, };
if (!rgb_dev) {
- _E("There is NO HAL");
+ _E("There is NO HAL.");
return -ENODEV;
}
if (!rgb_dev->set_state) {
- _E("LED HAL does not support set_state()");
+ _E("LED HAL does not support set_state().");
return -ENOTSUP;
}
if (kill(req->pid, 0) == -1) {
ret = remove_req_from_list(req->pid);
if (ret < 0)
- _E("Failed to remove rgb request (%d)", ret);
+ _E("Failed to remove rgb request: %d", ret);
}
}
if (!top) {
ret = rgb_play(NULL);
if (ret < 0)
- _E("Failed to turn off removed request (%d)", ret);
+ _E("Failed to turn off removed request: %d", ret);
}
if (DD_LIST_LENGTH(rgb_list) == 0) {
timer = g_timeout_add(5000, remove_not_handled_req, NULL);
if (timer == 0)
- _E("Failed to add timer");
+ _E("Failed to add timer.");
}
static int get_led_num(void)
return num_of_leds;
if (!rgb_dev) {
- _E("There is NO HAL");
+ _E("There is NO HAL.");
ret = -ENODEV;
goto out;
}
if (!rgb_dev->get_number) {
- _E("LED HAL does not support get_number()");
+ _E("LED HAL does not support get_number().");
ret = -ENOTSUP;
goto out;
}
ret = rgb_dev->get_number();
if (ret < 0) {
- _E("Failed to get LED number : %d", ret);
+ _E("Failed to get LED number: %d", ret);
goto out;
}
pid = dbus_connection_get_sender_pid(conn, sender);
- _I("pid %d led play custom %d, %d, %x", pid, on, off, color);
+ _I("Pid(%d) led play custom on=%d off=%d color=%x.", pid, on, off, color);
state.color = color;
state.duty_on = on;
ret = rgb_play(&state);
if (ret < 0) {
- _E("Failed to play LED notification (%d)", ret);
+ _E("Failed to play LED notification: %d", ret);
goto out;
}
pid = dbus_connection_get_sender_pid(conn, sender);
- _I("pid %d led stop custom", pid);
+ _I("Pid(%d) led stop custom.", pid);
ret = remove_req_from_list(pid);
if (ret < 0) {
- _E("There is no request from pid (%d) to remove", pid);
+ _E("There is no request from pid(%d) to remove.", pid);
goto out;
}
if (!top) {
ret = rgb_play(NULL);
if (ret < 0) {
- _E("Failed to play LED notification (%d)", ret);
+ _E("Failed to play LED notification: %d", ret);
goto out;
}
}
pid = dbus_connection_get_sender_pid(conn, sender);
- _I("pid %d multi led play control", pid);
+ _I("Pid(%d) multi led play control.", pid);
ret = get_led_num();
if (ret < 0)
g_variant_get(param, "(au)", &iter);
size = g_variant_iter_n_children(iter);
if (num_of_leds != size) {
- _E("Led number is not matched");
+ _E("Led number is not matched.");
ret = -EINVAL;
goto out;
}
state.color = color[i];
ret = rgb_play(&state);
if (ret < 0)
- _E("Failed to play LED notification (%d)", ret);
+ _E("Failed to play LED notification: %d.", ret);
++i;
}
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LED, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
ret = rgb_play(NULL);
if (ret < 0)
- _E("Failed to turn off rgb play during init");
+ _E("Failed to turn off rgb play during init.");
}
static void rgb_exit(void *data)
{
int ret = rgb_play(NULL);
if (ret < 0)
- _E("Failed to turn off rgb play during exit");
+ _E("Failed to turn off rgb play during exit.");
}
static int rgb_probe(void *data)
ret = hw_get_info(LED_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (ret < 0) {
- _E("There is no LED HAL");
+ _E("There is no LED HAL.");
return -ENOTSUP;
}
if (!info->open) {
- _E("Failed to open led device; open(NULL)");
+ _E("Failed to open led device: open(NULL)");
return -ENODEV;
}
ret = info->open(info, LED_ID_NOTIFICATION, (struct hw_common **)&rgb_dev);
if (ret < 0) {
- _E("Failed to get LED NOTIFICATION device structure (%d)", ret);
+ _E("Failed to get LED NOTIFICATION device structure: %d", ret);
return ret;
}
- _I("LED NOTIFICATION device structure load success");
+ _I("LED NOTIFICATION device structure load success.");
return 0;
}
int ret, alpha;
if (!led_dev) {
- _E("there is no led device");
+ _E("There is no led device.");
ret = -ENOENT;
goto error;
}
ret = alpha * 100.f / 255;
if (alpha != 0 && alpha != 0xFF)
ret += 1;
- _D("color : val(%d), color(%x)", ret, led_state.color);
+ _D("Get brightness. color=%x: %d", led_state.color, ret);
error:
return g_variant_new("(i)", ret);
g_variant_get(param, "(ii)", &val, &enable);
if (!led_dev) {
- _E("there is no led device");
+ _E("There is no led device.");
ret = -ENOENT;
goto error;
}
tmp.color = (((int)(val * 255.f) / LED_MAX_BRIGHTNESS) & 0xFF) << 24;
- _D("color : val(%d), color(%x)", val, tmp.color);
+ _D("Set brightness. val=%d color=%x", val, tmp.color);
ret = led_dev->set_state(&tmp);
if (ret < 0)
r = hw_get_info(LED_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (r < 0) {
- _E("fail to load led shared library : %d", r);
+ _E("Failed to load led shared library: %d", r);
return -ENOENT;
}
if (!info->open) {
- _E("fail to open camera led device : open(NULL)");
+ _E("Fail to open camera led device: open(NULL)");
return -EPERM;
}
r = info->open(info, LED_ID_CAMERA_BACK,
(struct hw_common **)&led_dev);
if (r < 0) {
- _E("fail to get camera led device : %d", r);
+ _E("Failed to get camera led device: %d", r);
return -EPERM;
}
- _D("camera led device structure load success");
+ _D("Camera led device structure load success.");
return 0;
}
/* init dbus interface */
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LED, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
}
static void torch_exit(void *data)
int r;
if (!touchled_dev || !touchled_dev->set_state) {
- _E("there is no led device");
+ _E("There is no led device.");
return -ENOENT;
}
r = touchled_dev->set_state(&tmp);
if (r < 0) {
- _E("fail to set touch led state : %d", r);
+ _E("Failed to set touch led state: %d", r);
return r;
}
r = hw_get_info(LED_HARDWARE_DEVICE_ID,
(const struct hw_info **)&info);
if (r < 0) {
- _E("fail to load led shared library : %d", r);
+ _E("Failed to load led shared library: %d", r);
return -ENOENT;
}
if (!info->open) {
- _E("fail to open touch led device : open(NULL)");
+ _E("Failed to open touch led device: open(NULL)");
return -EPERM;
}
r = info->open(info, LED_ID_TOUCH_KEY,
(struct hw_common **)&touchled_dev);
if (r < 0) {
- _E("fail to get touch led device : %d", r);
+ _E("Failed to get touch led device: %d", r);
return -EPERM;
}
- _D("touch led device structure load success");
+ _D("Touch led device structure load success.");
return 0;
}
{
/* get touchkey light duration setting */
if (vconf_get_int(VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION, &hardkey_duration) < 0) {
- _W("Fail to get VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION!!");
+ _W("Failed to get VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION.");
hardkey_duration = KEYBACKLIGHT_TIME_90;
}
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
val = -EBADMSG;
goto out;
}
- _D("%s-%s : %d", DEVICED_INTERFACE_PROCESS, type, val);
+ _D("%s-%s: %d", DEVICED_INTERFACE_PROCESS, type, val);
out:
g_variant_unref(msg);
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
val = -EBADMSG;
goto out;
}
- _D("%s-%s : %d", DEVICED_INTERFACE_POWER, type, val);
+ _D("%s-%s: %d", DEVICED_INTERFACE_POWER, type, val);
out:
g_variant_unref(msg);
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
val = -EBADMSG;
goto out;
}
- _SI("[%s] %s-%s(%s) : %d", name, DEVICED_INTERFACE_SYSNOTI, type, buf, val);
+ _SI("[%s] %s-%s(%s): %d", name, DEVICED_INTERFACE_SYSNOTI, type, buf, val);
out:
g_variant_unref(msg);
ret = deviced_get_cmdline_name(pid, name, sizeof(name));
if (ret != 0)
snprintf(name, sizeof(name), "%d", pid);
- _SI("[%s]start %s %ld", name, ALARM_INTERFACE_NAME, timet);
+ _SI("[%s]start %s %ld.", name, ALARM_INTERFACE_NAME, timet);
msg = dbus_handle_method_sync_with_reply_var(ALARM_BUS_NAME,
ALARM_PATH_NAME,
ALARM_SET_TIME_METHOD,
g_variant_new("(i)", timet));
if (!msg) {
- _E("dbus_message_new_method_call(%s:%s-%s)",
+ _E("Failed to call dbus_message_new_method_call(%s:%s-%s).",
ALARM_PATH_NAME, ALARM_INTERFACE_NAME, ALARM_SET_TIME_METHOD);
return -EBADMSG;
}
if (!dh_get_param_from_var(msg, "(i)", &val)) {
- _E("no message : type(%s)", g_variant_get_type_string(msg));
+ _E("Failed to get type(%s): no message", g_variant_get_type_string(msg));
val = -EBADMSG;
}
- _SI("[%s]end %s %ld, %d", name, ALARM_INTERFACE_NAME, timet, val);
+ _SI("[%s]End %s %ld: %d", name, ALARM_INTERFACE_NAME, timet, val);
g_variant_unref(msg);
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
val = -EBADMSG;
goto out;
}
- _D("%s-%s : %d", DEVICED_INTERFACE_SYSNOTI, type, val);
+ _D("%s-%s: %d", DEVICED_INTERFACE_SYSNOTI, type, val);
out:
g_variant_unref(msg);
return val;
dp = opendir("/proc");
if (!dp) {
- _E("open /proc");
+ _E("Failed to open '/proc'.");
return -1;
}
close(fd);
if (ret < 0) {
ret = -errno;
- _E("read() failed (%d)", ret);
+ _E("Failed to read(): %d", ret);
return ret;
}
buf[PATH_MAX] = '\0';
if (ret < 0)
return DISPLAY_MAX_BRIGHTNESS;
- _D("get max brightness : %d", ret);
+ _D("Get max brightness: %d", ret);
return ret;
}
METHOD_SET_BRIGHTNESS,
g_variant_new("(ii)", DISPLAY_STATE_NORMAL, val));
if (ret < 0)
- _E("no message : failed to setting");
+ _E("Failed to set brightness: no message.");
return ret;
}
return;
if (!dh_get_param_from_var(var, "(i)", &val)) {
- _E("no message [%s]", g_variant_get_type_string(var));
+ _E("Failed to get(%s): no message", g_variant_get_type_string(var));
g_variant_unref(var);
return;
}
g_variant_unref(var);
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, val);
+ _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, val);
}
API int display_change_state(unsigned int s_bits)
-1,
NULL);
if (ret < 0)
- _E("no message : failed to change state");
+ _E("Failed to change state: no message");
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, ret);
+ _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_CHANGE_STATE, ret);
return ret;
}
return;
if (!dh_get_param_from_var(var, "(i)", &val)) {
- _E("no message [%s]", g_variant_get_type_string(var));
+ _E("Failed to get(%s): no message", g_variant_get_type_string(var));
goto out;
}
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, val);
+ _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, val);
out:
g_variant_unref(var);
-1,
NULL);
if (ret < 0)
- _E("no message : failed to lock state");
+ _E("Failed to lock state: no message");
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, ret);
+ _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_LOCK_STATE, ret);
return ret;
}
return;
if (!dh_get_param_from_var(var, "(i)", &val)) {
- _E("no message [%s]", g_variant_get_type_string(var));
+ _E("Failed to get(%s): no message", g_variant_get_type_string(var));
goto out;
}
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, val);
+ _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, val);
out:
g_variant_unref(var);
-1,
NULL);
if (ret < 0)
- _E("no message : failed to unlock state");
+ _E("Failed to unlock state: no message");
- _D("%s-%s : %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, ret);
+ _D("%s-%s: %d", DEVICED_INTERFACE_DISPLAY, METHOD_UNLOCK_STATE, ret);
return ret;
}
API int haptic_get_count(int *device_number)
{
- _E("Not Supported, Please use capi-system-device apis");
+ _E("Not Supported. Please use capi-system-device apis.");
return HAPTIC_ERROR_OPERATION_FAILED;
}
API int haptic_open(haptic_device_e device_index, haptic_device_h *device_handle)
{
- _E("Not Supported, Please use capi-system-device apis");
+ _E("Not Supported. Please use capi-system-device apis.");
return HAPTIC_ERROR_OPERATION_FAILED;
}
API int haptic_close(haptic_device_h device_handle)
{
- _E("Not Supported, Please use capi-system-device apis");
+ _E("Not Supported. Please use capi-system-device apis.");
return HAPTIC_ERROR_OPERATION_FAILED;
}
API int haptic_vibrate_monotone(haptic_device_h device_handle, int duration, haptic_effect_h *effect_handle)
{
- _E("Not Supported, Please use capi-system-device apis");
+ _E("Not Supported. Please use capi-system-device apis.");
return HAPTIC_ERROR_OPERATION_FAILED;
}
API int haptic_stop_all_effects(haptic_device_h device_handle)
{
- _E("Not Supported, Please use capi-system-device apis");
+ _E("Not Supported. Please use capi-system-device apis.");
return HAPTIC_ERROR_OPERATION_FAILED;
}
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &ret_val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
ret_val = -EBADMSG;
}
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &ret_val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
ret_val = -EBADMSG;
}
return -EBADMSG;
if (!dh_get_param_from_var(msg, "(i)", &ret_val)) {
- _E("fail (signature:%s): no message", g_variant_get_type_string(msg));
+ _E("Failed to get signature(%s): no message", g_variant_get_type_string(msg));
ret_val = -EBADMSG;
}
handler = (struct signal_handler *)calloc(1, sizeof(struct signal_handler));
if (!handler) {
- _E("No memory");
+ _E("Failed to calloc: No memory");
ret = -1;
goto out;
}
handler->data = data;
handler->id = subscribe_dbus_signal(NULL, path, iface, name, cb, NULL, NULL);
if (!handler->id) {
- _E("fail to add dbus handler");
+ _E("Failed to add dbus handler.");
ret = -1;
goto out;
}
API int init_usbhost_signal(void)
{
- _D("init");
+ _D("Init.");
return 0;
}
&fdlist,
&size);
if (!reply) {
- _E("Unable to open USB device");
+ _E("Unable to open USB device.");
return -1;
}
if (size == 0) {
- _E("failed to get fd list");
+ _E("Failed to get fd list.");
return -1;
}
if (!dh_get_param_from_var(reply, "(i)", &ret)) {
- _E("no message [%s]", g_variant_get_type_string(reply));
+ _E("Failed to get(%s): no message.", g_variant_get_type_string(reply));
ret = -1;
goto out;
}
ret = vconf_set_int(VCONFKEY_SYSMAN_LOW_POWER_MODE,
VCONFKEY_SYSMAN_LOW_POWER_MODE_ON);
if (ret != 0) {
- _E("Failed to enable low power mode");
+ _E("Failed to enable low power mode.");
return -ENOMEM;
}
low_power_enabled = true;
- _I("Low Power Mode Start");
+ _I("Low Power Mode Start.");
return 0;
}
ret = vconf_set_int(VCONFKEY_SYSMAN_LOW_POWER_MODE,
VCONFKEY_SYSMAN_LOW_POWER_MODE_OFF);
if (ret != 0) {
- _E("Failed to disable low power mode");
+ _E("Failed to disable low power mode.");
return -ENOMEM;
}
low_power_enabled = false;
- _I("Low Power Mode Stop");
+ _I("Low Power Mode Stop.");
return 0;
}
ret = vconf_get_int(VCONFKEY_SYSMAN_LOW_POWER_MODE, &mode);
if (ret == 0 && mode == VCONFKEY_SYSMAN_LOW_POWER_MODE_ON) {
- _I("Low Power Mode Start");
+ _I("Low Power Mode Start.");
low_power_enabled = true;
}
pid_t pid;
if (!booting_done(NULL)) {
- _I("Booting is not done yet");
+ _I("Booting is not done yet.");
ret = -EAGAIN;
goto out;
}
pid = dbus_connection_get_sender_pid(conn, sender);
- _I("Low Power Mode started by PID(%d)", pid);
+ _I("Low Power Mode started by PID(%d).", pid);
ret = low_power_start(NULL);
if (ret < 0)
- _E("Failed to start Low Power Mode(%d)", ret);
+ _E("Failed to start Low Power Mode(%d).", ret);
out:
return g_variant_new("(i)", ret);
pid_t pid;
if (!booting_done(NULL)) {
- _I("Booting is not done yet");
+ _I("Booting is not done yet.");
ret = -EAGAIN;
goto out;
}
pid = dbus_connection_get_sender_pid(conn, sender);
- _I("Low Power Mode stopped by PID(%d)", pid);
+ _I("Low Power Mode stopped by PID(%d).", pid);
ret = low_power_stop(NULL);
if (ret < 0)
- _E("Failed to stop Low Power Mode(%d)", ret);
+ _E("Failed to stop Low Power Mode(%d).", ret);
out:
return g_variant_new("(i)", ret);
/* init dbus interface */
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_LOWPOWER, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method(%d).", ret);
register_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done);
}
ret = low_power_stop(NULL);
if (ret < 0)
- _E("Failed to stop Low Power Mode(%d)", ret);
+ _E("Failed to stop Low Power Mode(%d).", ret);
unregister_notifier(DEVICE_NOTIFIER_BOOTING_DONE, booting_done);
}
ret = systemd_start_unit_async("shutdown-animation.service", NULL);
if (ret < 0)
- _E("Failed to start shutdown animation");
+ _E("Failed to start shutdown animation.");
gettimeofday(&tv_start_poweroff, NULL);
}
static void poweroff_notify_resourced(void)
{
- _I("Request to stop systemd service to resourced");
+ _I("Request to stop systemd service to resourced.");
dbus_handle_method_sync_timeout(RESOURCED_BUS_NAME,
RESOURCED_PATH_PROCESS,
RESOURCED_INTERFACE_PROCESS,
ret = systemd_stop_unit_async("systemd-journald.socket", NULL);
if (ret < 0) {
- _E("failed to stop 'systemd-journald.socket'");
+ _E("Failed to stop 'systemd-journald.socket'.");
return ret;
}
ret = systemd_stop_unit_async("systemd-journald.service", NULL);
if (ret < 0) {
- _E("failed to stop 'systemd-journald.service'");
+ _E("Failed to stop 'systemd-journald.service'.");
return ret;
}
return 0;
}
bool is_ok = ret > 0;
- _I("Disabling core dumps %s", is_ok ? "succeeded" : "failed");
+ _I("Disabling core dumps %s.", is_ok ? "succeeded" : "failed");
return is_ok;
}
static void poweroff_request_shutdown()
{
- _I("Requested power off via systemd");
+ _I("Requested power off via systemd.");
char *method;
else if (poweroff_opt.type == POWER_OFF_EXIT)
method = "Exit";
else {
- _E("poweroff invalid type (%d)", poweroff_opt.type);
+ _E("Poweroff invalid type(%d).", poweroff_opt.type);
return;
}
check_duration = now.tv_sec - tv_start_poweroff.tv_sec;
while (check_duration < poweroff_duration) {
if (wait == 0) {
- _I("wait poweroff %d %d", check_duration, poweroff_duration);
+ _I("Wait poweroff %d %d.", check_duration, poweroff_duration);
wait = 1;
}
usleep(100000);
fd = open(path, O_RDWR|O_CREAT, S_IRUSR | S_IWUSR);
if (fd < 0) {
- _E("Failed to create (%s)", path);
+ _E("Failed to create '%s'.", path);
return;
}
if (option) {
len = write(fd, option, strlen(option));
if (len <= 0)
- _E("Failed to store option (%zd)", len < 0 ? errno : len);
+ _E("Failed to store option: %zd", len < 0 ? errno : len);
}
close(fd);
assert(handle);
- _D("Remove handle pid(%d) timeout(%d) timeout_id(%d)", handle->pid, handle->timeout, handle->timeout_id);
+ _D("Remove handle pid=%d timeout=%d timeout_id=%d.", handle->pid, handle->timeout, handle->timeout_id);
DD_LIST_REMOVE(poweroff_handles, handle);
if (handle->timeout_id) {
poweroff_remove_handle(pid);
if (DD_LIST_LENGTH(poweroff_handles)) {
- _D("Timer is left");
+ _D("Timer is left.");
return G_SOURCE_REMOVE;
}
- _D("No timer left");
+ _D("No timer left.");
char *name = poweroff_type_to_name(poweroff_opt.type);
if (!name) {
- _E("Invalid type (%d)", poweroff_opt.type);
+ _E("Invalid type(%d).", poweroff_opt.type);
goto out;
}
DD_LIST_FOREACH(poweroff_handles, l, handle) {
pid_alive = kill(handle->pid, 0);
if (pid_alive == -1) {
- _D("Pid(%d) is dead", handle->pid);
+ _D("Pid(%d) is dead.", handle->pid);
handle->timeout = 0;
}
- _D("Run timer, pid(%d) timeout(%d) timeout_id(%d)", handle->pid, handle->timeout, handle->timeout_id);
+ _D("Run timer, pid=%d timeout=%d timeout_id=%d.", handle->pid, handle->timeout, handle->timeout_id);
handle->timeout_id = g_timeout_add_seconds(handle->timeout,
poweroff_timeout_cb,
(void *)((intptr_t)(handle->pid)));
if (timer_exist) {
return;
} else {
- _D("handle is NULL");
+ _D("Handle is NULL.");
handle = (struct poweroff_handle *)malloc(sizeof(struct poweroff_handle));
if (handle == NULL) {
_E("Not enough memory.");
(void *)((intptr_t)(handle->pid)));
if (!handle->timeout_id) {
- _E("timer_add failed");
+ _E("Failed to timer_add.");
free(handle);
return;
}
DD_LIST_APPEND(poweroff_handles, handle);
}
- _D("Last Timer : timer_id(%d) pid(%d) timeout(%d)", handle->timeout_id, handle->pid, handle->timeout);
+ _D("Last Timer: timer_id=%d pid=%d timeout=%d", handle->timeout_id, handle->pid, handle->timeout);
return;
}
if (old == status)
return;
- _D("broadcast poweroff %d", status);
+ _D("Broadcast poweroff %d.", status);
old = status;
static int power_execute_pid(char *type, char *option, pid_t pid)
{
if (during_poweroff) {
- _E("during poweroff");
+ _E("During poweroff.");
return -EINVAL;
}
enum poweroff_type type_e = poweroff_name_to_type(type);
if (type_e == POWER_OFF_INVALID) {
- _E("Failed to get type enum value (%d)", type_e);
+ _E("Failed to get type enum value(%d).", type_e);
return -EINVAL;
}
if (poweroff_option_valid(type_e, option)) {
if (option)
poweroff_opt.option = strdup(option);
} else {
- _E("Failed to find supported %s option %s", type, (option ? option : "NULL"));
+ _E("Failed to find supported type(%s). option=%s", type, (option ? option : "NULL"));
return -EINVAL;
}
if (poweroff_opt.type == POWER_OFF_POPUP) {
- _D("request popup");
+ _D("Request popup.");
vconf_set_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, poweroff_opt.type);
pwroff_popup();
return 0;
g_variant_get(param, "(si)", &type_str, &argc);
if (argc < 0) {
- _E("message is invalid!");
+ _E("Message is invalid.");
ret = -EINVAL;
goto out;
}
pid = dbus_connection_get_sender_pid(conn, sender);
if (kill(pid, 0) == -1) {
- _E("%d process does not exist, dbus ignored!", pid);
+ _E("Process(%d) does not exist, dbus ignored.", pid);
ret = -ESRCH;
goto out;
}
- _I("poweroff PID(%d) requests %s", pid, type_str);
+ _I("Poweroff PID(%d) requests %s.", pid, type_str);
ret = power_execute_pid(type_str, NULL, pid);
out:
pid = dbus_connection_get_sender_pid(conn, sender);
if (kill(pid, 0) == -1) {
- _E("%d process does not exist, dbus ignored!", pid);
+ _E("Process(%d) does not exist, dbus ignored.", pid);
ret = -ESRCH;
goto out;
}
- _I("poweroff PID(%d) requests %s %s", pid, type, option);
+ _I("Poweroff PID(%d) requests type=%s option=%s.", pid, type, option);
ret = power_execute_pid(type, option, pid);
out:
pid = dbus_connection_get_sender_pid(conn, sender);
- _I("poweroff PID(%d) requests reboot with command : %s", pid, str);
+ _I("Poweroff PID(%d) requests reboot with command(%s).", pid, str);
ret = power_execute_pid(POWER_REBOOT, NULL, pid);
g_free(str);
dd_list *l;
pid = dbus_connection_get_sender_pid(conn, sender);
- _D("add_poweroff_timer(%d)", pid);
+ _D("add_poweroff_timer pid=%d", pid);
if (pid == -1) {
_E("Failed to get sender's pid.");
ret = -1;
if (handle)
poweroff_remove_handle(pid);
- _D("Make a new handle");
+ _D("Make a new handle.");
handle = (struct poweroff_handle *)malloc(sizeof(struct poweroff_handle));
if (handle == NULL) {
_E("Not enough memory.");
handle->timeout = POWEROFF_WAIT_MAX;
DD_LIST_APPEND(poweroff_handles, handle);
- _D("Add a new poweroff timer(%d %d %d)", handle->pid, handle->timeout, handle->timeout_id);
+ _D("Add a new poweroff timer. pid=%d timeout=%d timeout_id=%d)", handle->pid, handle->timeout, handle->timeout_id);
ret = 0;
pid_t pid;
pid = dbus_connection_get_sender_pid(conn, sender);
- _D("remove_poweroff_timer(%d)", pid);
+ _D("Remove_poweroff_timer pid=%d", pid);
if (pid == -1) {
_E("Failed to get sender's pid.");
ret = -1;
(void *)((intptr_t)(handle->pid)));
}
} else {
- _E("Invalid pid(%d)", pid);
+ _E("Invalid pid(%d).", pid);
ret = -1;
}
name = poweroff_type_to_name(type);
if (!name) {
- _E("Invalid type (%d)", type);
+ _E("Invalid type(%d).", type);
return -EINVAL;
}
opt = calloc(1, sizeof(struct power_option));
if (!opt) {
- _E("calloc() failed");
+ _E("Failed to calloc().");
return -ENOMEM;
}
DD_LIST_APPEND(poweroff_options, opt);
- _D("Add %s option (%s)", name, opt->option);
+ _D("Add %s option=%s", name, opt->option);
return 0;
}
ret = add_poweroff_option(type, result->value);
if (ret < 0) {
- _E("Failed to add %s option (%s)", result->section, result->value);
+ _E("Failed to add %s option=%s", result->section, result->value);
return ret;
}
/* init dbus interface */
ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_REBOOT, &dbus_interface);
if (ret < 0)
- _E("fail to init dbus method(%d)", ret);
+ _E("Failed to init dbus method: %d", ret);
add_booting_done_handler(NULL);
ret = config_parse(POWER_CONF_FILE, load_config, NULL);
if (ret < 0)
- _E("Failed to load power off config (%d)", ret);
+ _E("Failed to load power off config: %d", ret);
}
static const struct device_ops power_device_ops = {