Modify usb debug message 72/227772/4
authorINSUN PYO <insun.pyo@samsung.com>
Mon, 16 Mar 2020 08:48:27 +0000 (17:48 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Mon, 16 Mar 2020 08:50:57 +0000 (08:50 +0000)
Change-Id: I0a3c558221010674a489d9d196db76b0f3d7a96a

src/usb/usb-dbus.c
src/usb/usb-debug.c
src/usb/usb-state.c
src/usb/usb.c

index 977f592..479991b 100644 (file)
@@ -41,7 +41,7 @@ static int get_usb_state(void)
 
        ret = vconf_get_int(VCONFKEY_SYSMAN_USB_STATUS, &val);
        if (ret != VCONF_OK) {
-               _E("Failed to get vconf value for usb_status: %d", vconf_get_ext_errno());
+               _E("Failed to get vconf value for USB status: %d", vconf_get_ext_errno());
                return ret;
        }
 
@@ -75,7 +75,7 @@ void broadcast_usb_state_changed(void)
                        SIGNAL_STATE_CHANGED,
                        g_variant_new("(u)", state));
        if (ret < 0)
-               _E("Failed to send dbus signal.");
+               _E("Failed to send USB dbus signal.");
 }
 
 static void change_usb_client_mode(GDBusConnection  *conn,
@@ -93,7 +93,7 @@ static void change_usb_client_mode(GDBusConnection  *conn,
 
        g_variant_get(param, "(i)", &req_vconf);
        if (req_vconf < 0) {
-               _E("Failed to get req_vconf.");
+               _E("Failed to get USB req_vconf.");
                return;
        }
 
@@ -102,7 +102,7 @@ static void change_usb_client_mode(GDBusConnection  *conn,
        mode = get_mode_bitmap_from_vconf(req_vconf);
 
        if (mode == USB_FUNCTION_INVALID) {
-               _E("Failed to convert vconf to mode. There is no mode matches up with vconf %d.", req_vconf);
+               _E("Failed to convert vconf to USB mode. There is no mode matches up with vconf %d.", req_vconf);
                return;
        }
 
@@ -160,13 +160,13 @@ int usb_dbus_init(void)
 
        ret = dbus_handle_add_dbus_object(NULL, DEVICED_PATH_USB, &dbus_interface);
        if (ret < 0)
-               _E("Failed to init dbus method: %d", ret);
+               _E("Failed to init dbus method for USB: %d", ret);
 
        ret = subscribe_dbus_signal(NULL, DEVICED_PATH_USB,
                DEVICED_INTERFACE_USB, "ChangeUsbMode",
                change_usb_client_mode, NULL, NULL);
        if (ret <= 0) {
-               _E("Failed to subscribe dbus signal: %d", ret);
+               _E("Failed to subscribe dbus signal for USB: %d", ret);
                return ret;
        }
 
index 878e090..d45409b 100644 (file)
@@ -121,7 +121,7 @@ void add_usb_debug_handler(void)
 
        if (vconf_notify_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL,
                                usb_debug_changed, NULL) != VCONF_OK)
-               _E("Failed to add usb debug handler.");
+               _E("Failed to add USB debug handler.");
 
        register_notifier(DEVICE_NOTIFIER_USB_DEBUG_MODE, usb_debug_mode_changed);
 
index 5c78903..02b0072 100644 (file)
@@ -117,7 +117,7 @@ static void usb_state_send_system_event(int status)
                return;
        }
 
-       _I("system_event(%s)", str);
+       _I("USB system_event (%s)", str);
 
        b = bundle_create();
        bundle_add_str(b, EVT_KEY_USB_STATUS, str);
@@ -197,7 +197,7 @@ int usb_state_set_selected_mode(unsigned int mode)
 
        mode_v = get_mode_vconf_from_bitmap(mode);
        if (mode_v == SET_USB_INVALID) {
-               _E("Failed to convert selected_mode to vconf. There is no vconf matches up with mode 0x%x", mode);
+               _E("Failed to convert USB selected_mode to vconf. There is no vconf matches up with USB mode 0x%x", mode);
                return -EINVAL;
        }
 
@@ -225,7 +225,7 @@ int usb_state_set_current_mode(unsigned int mode)
 
        mode_v = get_mode_vconf_from_bitmap(mode);
        if (mode_v == SET_USB_INVALID) {
-               _E("Failed to convert current_mode to vconf. There is no vconf matches up with mode 0x%x", mode);
+               _E("Failed to convert USB current_mode to vconf. There is no vconf matches up with mode 0x%x", mode);
                return -EINVAL;
        }
 
@@ -255,17 +255,17 @@ static void media_noti_cb(GVariant *var, void *user_data, GError *err)
 
        if (!var) {
                if (err)
-                       _E("Error: %s", err->message);
+                       _E("USB media notification error: %s", err->message);
                return;
        }
 
        if (!dh_get_param_from_var(var, "(i)", &id)) {
-               _E("Failed to get variant(%s): no message", g_variant_get_type_string(var));
+               _E("Failed to get variant(%s): no USB notification message", g_variant_get_type_string(var));
                goto out;
        }
 
        noti_id = id;
-       _D("Media noti(%d)", noti_id);
+       _D("USB media notification message(%d)", noti_id);
 
 out:
        g_variant_unref(var);
@@ -278,7 +278,7 @@ static void add_notification_handler(void)
        if (noti_id < 0) {
                ret = add_async_notification("MediaDeviceNotiOn", media_noti_cb, NULL, NULL);
                if (ret < 0)
-                       _E("Failed to show notification for usb connection.");
+                       _E("Failed to add USB notification for usb connection: %d", ret);
        }
 }
 
@@ -289,7 +289,7 @@ static void remove_notification_handler(void)
        if (noti_id >= 0) {
                ret = remove_notification("MediaDeviceNotiOff", noti_id);
                if (ret < 0)
-                       _E("Failed to remove event_noti: %d", ret);
+                       _E("Failed to remove USB notification for usb connection: %d", ret);
                else
                        noti_id = -1;
        }
index 2be5c81..66faa97 100644 (file)
@@ -48,7 +48,7 @@ static struct usb_gadget_translator *gadget_translator_probe(void)
        }
 
        if (!info->open) {
-               _E("Failed to open USB gadget translator: open(NULL)");
+               _E("USB gadget does not have open() ");
                return NULL;
        }
 
@@ -79,12 +79,12 @@ static struct usb_client *usb_client_probe(const char *id)
        _I("Loading USB client. id=%s", id);
 
        if (hw_get_info(id, (const struct hw_info **)&info)) {
-               _I("No usb_client. id=%s", id);
+               _I("No USB client. id=%s", id);
                return NULL;
        }
 
        if (!info->open) {
-               _E("Failed to open USB client(%s): open(NULL)", id);
+               _E("USB client does not have open(). id=%s", id);
                return NULL;
        }
 
@@ -218,14 +218,14 @@ static int usb_change_gadget(unsigned mode)
 
        ret = gadget_translator->id_to_gadget(&gadget_id, &gadget);
        if (ret) {
-               _E("Unable to translate id into gadget: %d", ret);
+               _E("Unable to translate USB mode id into gadget: %d", ret);
                goto out;
        }
 
        ret = usb_client->reconfigure_gadget(usb_client, gadget);
        gadget_translator->cleanup_gadget(gadget);
        if (ret) {
-               _E("Unable to configure gadget: %d", ret);
+               _E("Unable to configure USB gadget: %d", ret);
                goto out;
        }
 
@@ -272,7 +272,7 @@ static int usb_disable(void)
 
        ret = usb_config_disable();
        if (ret < 0) {
-               _E("Failed to disable usb config: %d", ret);
+               _E("Failed to disable USB config: %d", ret);
                return ret;
        }
 
@@ -358,7 +358,7 @@ int usb_change_mode(unsigned int new_mode)
         */
        ret = usb_change_gadget(new_mode);
        if (ret < 0) {
-               _E("Failed to change gadget: %d", ret);
+               _E("Failed to change USB gadget: %d", ret);
                return ret;
        }
 
@@ -426,7 +426,7 @@ static void uevent_usb_mode_handler(struct udev_device *dev)
        if (strncmp(state, "CONFIGURED", strlen(state) + 1))
                return;
 
-       _I("usb_mode udev event happend : CONFIGURED");
+       _I("USB udev event happend : CONFIGURED USB_STATE");
 
        if (usb_state_get_selected_mode() & USB_FUNCTION_ACM)
                systemd_start_unit_wait_started ("data-router.service", NULL, -1);
@@ -461,11 +461,11 @@ static void usb_init(void *data)
 
        ret = register_udev_uevent_control(&uh);
        if (ret < 0)
-               _E("Failed to register udev event(%d)", ret);
+               _E("Failed to register udev event(%d) for USB", ret);
 
        ret = usb_dbus_init();
        if (ret < 0)
-               _E("Failed to init dbus: %d", ret);
+               _E("Failed to init dbus(%d) for USB", ret);
 
        add_usb_tethering_handler();
        add_usb_debug_handler();