input: clean up devicemgr related code 89/280689/1
authorduna.oh <duna.oh@samsung.com>
Fri, 2 Sep 2022 07:46:52 +0000 (16:46 +0900)
committerduna.oh <duna.oh@samsung.com>
Fri, 2 Sep 2022 07:46:52 +0000 (16:46 +0900)
Change-Id: Ia8f04b19f3d41a7dc476201b1525a2377767f032

src/input/input.c

index 638c5f7..bdc8a3f 100644 (file)
@@ -349,16 +349,14 @@ devicemgr_add_keymap_data(struct wl_list *list, const char *name, int keycode)
 }
 
 static void
-devicemgr_remove_keymap_data(struct wl_list *list, int keycode)
+devicemgr_cleanup_keymap_list(struct wl_list *list)
 {
        struct ds_tizen_input_devicemgr_keymap_data *data, *tmp;
 
        wl_list_for_each_safe(data, tmp, list, link) {
-               if (data->keycode == keycode) {
-                       wl_list_remove(&data->link);
-                       free(data->name);
-                       free(data);
-               }
+               wl_list_remove(&data->link);
+               free(data->name);
+               free(data);
        }
 }
 
@@ -383,8 +381,5 @@ devicemgr_set_keymap(struct ds_tizen_input_devicemgr *devicemgr)
        if (!res)
                ds_inf("Failed to set keymap");
 
-       devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_VOLUME_RAISE);
-       devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_VOLUME_LOWER);
-       devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_LIGHT_ON);
-       devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_LIGHT_OFF);
+       devicemgr_cleanup_keymap_list(&keymap_list);
 }