sound: Remove sound_set_path() 85/302785/1
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 7 Dec 2023 06:24:31 +0000 (15:24 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Tue, 12 Dec 2023 08:02:34 +0000 (17:02 +0900)
From b27c0d29aff919b34ec17a59411fff789aa6017e this commit, set_path became unreachable.
Before changing feedback pattern data structure, it is necessary to clean up unused function.

Change-Id: I7c902857db19107705a15bf9d4dbc4ce78a9cba9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/sound.c

index e9fdd59..3c7c635 100644 (file)
@@ -422,62 +422,6 @@ static int sound_get_path(feedback_pattern_e pattern, char *buf, unsigned int bu
 }
 //LCOV_EXCL_STOP
 
-//LCOV_EXCL_START Not used function
-static int sound_set_path(feedback_pattern_e pattern, char *path)
-{
-       struct stat buf;
-       int i;
-       int index = -1;
-       int ret = 0;
-       struct feedback_config_info *sound_info = NULL;
-
-       /*
-        * check the path is valid
-        * if path is null, below operation is ignored
-        */
-       if (path && stat(path, &buf)) {
-               _E("%s is not presents", path);
-               return -errno;
-       }
-
-       if (!profile->str_pattern(pattern)) {
-               _E("%d is not supported", pattern);
-               return -EPERM;
-       }
-
-       ret = sound_thememan_get_sound_theme_info(current_theme_id, &sound_info);
-       if (ret < 0)
-               return -EPERM;
-
-       for (i = 0; i < profile->get_num_of_pattern(); i++) {
-               if (pattern == sound_info->data[i].pattern) {
-                       index = i;
-                       break;
-               }
-       }
-
-       if (index < 0) {
-               for (i = 0; i < profile->get_num_of_pattern(); i++) {
-                       if (sound_info->data[i].pattern != -1)
-                               continue;
-
-                       sound_info->data[i].pattern = pattern;
-
-                       _D("The file of pattern(%s) is changed to [%s]",
-                                       profile->str_pattern(pattern), path? path:"NULL");
-
-                       return 0;
-               }
-               _E("%d is not supported", pattern);
-               return -EPERM;
-       }
-
-       _D("The file of pattern(%s) is changed to [%s]",
-                       profile->str_pattern(pattern), path);
-       return 0;
-}
-//LCOV_EXCL_STOP
-
 static int sound_get_count_of_theme(unsigned int *count_of_theme)
 {
        int ret = 0;
@@ -543,7 +487,7 @@ static const struct device_ops sound_device_ops = {
        .stop = sound_stop,
        .is_supported = sound_is_supported,
        .get_path = sound_get_path,
-       .set_path = sound_set_path,
+       .set_path = NULL,
        .get_count_of_theme = sound_get_count_of_theme,
        .get_theme_id = sound_get_theme_id,
        .set_theme_id = sound_set_theme_id,