@@ -279,8 +279,6 @@ static int is_smart_protocol(void)
279279#define MAX_RECV_TRIES 10
280280#define RECV_WAIT_MSEC 1000 /*!< was 100 for OMNIVS; SMARTPRO units need longer */
281281
282- #define MAX_RECONNECT_TRIES 10
283-
284282#define DEFAULT_OFFDELAY 64 /*!< seconds (max 0xFF) */
285283#define DEFAULT_STARTDELAY 60 /*!< seconds (max 0xFFFFFF) */
286284#define DEFAULT_BOOTDELAY 64 /*!< seconds (max 0xFF) */
@@ -677,8 +675,6 @@ void upsdrv_initinfo(void);
677675 */
678676static void usb_comm_fail (int res , const char * msg )
679677{
680- static int try_num = 0 ;
681-
682678 switch (res ) {
683679 case LIBUSB_ERROR_BUSY :
684680 upslogx (LOG_WARNING ,
@@ -689,26 +685,18 @@ static void usb_comm_fail(int res, const char *msg)
689685#endif
690686
691687 default :
692- reconnect_trying (RECONNECT_TRYING );
693- /* FIXME [#3541]: Clean up driver custom tracking and MAX tolerance */
694688 upslogx (LOG_WARNING ,
695689 "%s: Device detached? (error %d: %s)" ,
696690 msg , res , nut_usb_strerror (res ));
697691
698- upslogx (LOG_NOTICE , "Reconnect attempt #%d" , ++ try_num );
699692 hd = NULL ;
700693 reconnect_ups ();
701694
702695 if (hd ) {
703696 upslogx (LOG_NOTICE , "Successfully reconnected" );
704- try_num = 0 ;
705697 reconnect_trying (RECONNECT_UPDATEINFO );
706698 upsdrv_initinfo ();
707699 reconnect_trying (RECONNECT_SUCCESS );
708- } else {
709- if (try_num > MAX_RECONNECT_TRIES ) {
710- fatalx (EXIT_FAILURE , "Too many unsuccessful reconnection attempts" );
711- }
712700 }
713701 break ;
714702 }
0 commit comments