Remove duplicated codes 48/222248/1
authorhj kim <backto.kim@samsung.com>
Mon, 13 Jan 2020 03:03:45 +0000 (12:03 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 13 Jan 2020 03:03:45 +0000 (12:03 +0900)
Change-Id: I38e7ffe94280e8f11d7e604b959130bc0502dcd6

src/server/media-server-device-block.c

index c804b3b..378ddb2 100644 (file)
 #include "media-server-db-manage.h"
 #include "media-server-device-block.h"
 
-#ifndef _USE_DEVICED_DBUS
-static int __ms_get_added_storage_path(const char *add_path, char **device_id)
-{
-       int ret = MS_MEDIA_ERR_NONE;
-       char *id = NULL;
-
-       *device_id = NULL;
-
-       /* read deive information */
-       ret = ms_read_device_info(add_path, &id);
-       if (id == NULL) {
-               if (ret == MS_MEDIA_ERR_FILE_NOT_EXIST) {
-                       ret = ms_genarate_uuid(&id);
-                       ret = ms_write_device_info(add_path , id);
-                       if (ret == MS_MEDIA_ERR_NONE)
-                               *device_id = strdup(id);
-               }
-       } else {
-               *device_id = strdup(id);
-       }
-
-       MS_SAFE_FREE(id);
-
-       return ret;
-}
-#endif
-
 int ms_storage_insert_handler(const char *mount_path, const char *mount_uuid)
 {
        int ret = MS_MEDIA_ERR_NONE;
@@ -180,7 +153,7 @@ static void __ms_usb_add_event(const char *mount_path)
        if (mount_path != NULL) {
                MS_DBG_SWARN("added path [%s]", mount_path);
 
-               __ms_get_added_storage_path(mount_path, &storage_id);
+               ms_get_added_storage_path(mount_path, &storage_id);
 
                if (storage_id != NULL) {
                        /* update storage information into media DB */