@@ -578,7 +578,7 @@ namespace librealsense
578578            }
579579        }
580580
581-         bool  v4l_uvc_device::get_devname_from_video_path (const  std::string& video_path, std::string& devname,  bool  is_for_dfu )
581+         bool  v4l_uvc_device::get_devname_from_video_path (const  std::string& video_path, std::string& devname)
582582        {
583583            std::ifstream uevent_file (video_path + " /uevent" 
584584            if  (!uevent_file)
@@ -591,14 +591,10 @@ namespace librealsense
591591            {
592592                if  (uevent_line.find (" DEVNAME=" 
593593                {
594-                     devname = uevent_line.substr (uevent_line.find_last_of (' =' 1 );
594+                     devname = " /dev/ "  +  uevent_line.substr (uevent_line.find_last_of (' =' 1 );
595595                }
596596            }
597597            uevent_file.close ();
598-             if  (!is_for_dfu)
599-             {
600-                 devname = " /dev/" 
601-             }
602598            return  true ;
603599        }
604600
@@ -690,8 +686,7 @@ namespace librealsense
690686                        continue ;
691687                    }
692688                    std::string devname;
693-                     bool  for_dfu = true ;
694-                     if  (get_devname_from_video_path (real_path, devname, for_dfu))
689+                     if  (get_devname_from_video_path (real_path, devname))
695690                    {
696691                        if  (devname.empty ())
697692                        {
@@ -907,11 +902,10 @@ namespace librealsense
907902            std::vector<std::string> dfu_device_paths = get_mipi_dfu_paths ();
908903
909904            for  (const  auto & dfu_device_path: dfu_device_paths) {
910-                 auto  mipi_dfu_chardev = " /dev/" 
911-                 int  vfd = open (mipi_dfu_chardev.c_str (), O_RDONLY | O_NONBLOCK);
905+                 int  vfd = open (dfu_device_path.c_str (), O_RDONLY | O_NONBLOCK);
912906                if  (vfd >= 0 ) {
913907                    //  Use legacy DFU device node used in firmware_update_manager
914-                     info.dfu_device_path  = mipi_dfu_chardev ;
908+                     info.dfu_device_path  = dfu_device_path ;
915909                    ::close (vfd); //  file exists, close file and continue to assign it
916910                    break ;
917911                }
0 commit comments