diff --git a/ikvm_input.cpp b/ikvm_input.cpp
index d95e631..df12f27 100644
--- a/ikvm_input.cpp
+++ b/ikvm_input.cpp
@@ -23,9 +23,9 @@
 using namespace sdbusplus::xyz::openbmc_project::Common::File::Error;
 
 Input::Input(const std::string& kbdPath, const std::string& ptrPath) :
-    pointerError(false), sendKeyboard(false), sendPointer(false),
-    keyboardFd(-1), pointerFd(-1), keyboardReport{0}, pointerReport{0},
-    keyboardPath(kbdPath), pointerPath(ptrPath)
+    sendKeyboard(false), sendPointer(false), keyboardFd(-1), pointerFd(-1),
+    keyboardReport{0}, pointerReport{0}, keyboardPath(kbdPath),
+    pointerPath(ptrPath)
 {
     if (!keyboardPath.empty())
     {
@@ -156,36 +156,6 @@
     rfbDefaultPtrAddEvent(buttonMask, x, y, cl);
 }
 
-void Input::restart()
-{
-    if (!keyboardPath.empty() && keyboardFd < 0)
-    {
-        keyboardFd = open(keyboardPath.c_str(), O_RDWR | O_CLOEXEC);
-        if (keyboardFd < 0)
-        {
-            log<level::ERR>("Failed to open input device",
-                            entry("PATH=%s", keyboardPath.c_str()),
-                            entry("ERROR=%s", strerror(errno)));
-        }
-
-        sendKeyboard = false;
-    }
-
-    if (!pointerPath.empty() && pointerFd < 0)
-    {
-        pointerFd = open(pointerPath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK);
-        if (pointerFd < 0)
-        {
-            log<level::ERR>("Failed to open input device",
-                            entry("PATH=%s", pointerPath.c_str()),
-                            entry("ERROR=%s", strerror(errno)));
-        }
-
-        pointerError = false;
-        sendPointer = false;
-    }
-}
-
 void Input::sendWakeupPacket()
 {
     uint8_t wakeupReport[KEY_REPORT_LENGTH] = {0};
@@ -459,13 +429,10 @@
 {
     if (write(keyboardFd, report, KEY_REPORT_LENGTH) != KEY_REPORT_LENGTH)
     {
-        log<level::ERR>("Failed to write keyboard report",
-                        entry("ERROR=%s", strerror(errno)));
-
-        if (errno == ESHUTDOWN)
+        if (errno != ESHUTDOWN && errno != EAGAIN)
         {
-            close(keyboardFd);
-            keyboardFd = -1;
+            log<level::ERR>("Failed to write keyboard report",
+                            entry("ERROR=%s", strerror(errno)));
         }
 
         return false;
@@ -478,22 +445,11 @@
 {
     if (write(pointerFd, report, PTR_REPORT_LENGTH) != PTR_REPORT_LENGTH)
     {
-        if (!pointerError)
+        if (errno != ESHUTDOWN && errno != EAGAIN)
         {
             log<level::ERR>("Failed to write pointer report",
                             entry("ERROR=%s", strerror(errno)));
-            pointerError = true;
         }
-
-        if (errno == ESHUTDOWN)
-        {
-            close(pointerFd);
-            pointerFd = -1;
-        }
-    }
-    else
-    {
-        pointerError = false;
     }
 }
 
diff --git a/ikvm_input.hpp b/ikvm_input.hpp
index 9533332..2adc7c1 100644
--- a/ikvm_input.hpp
+++ b/ikvm_input.hpp
@@ -48,8 +48,6 @@
      */
     static void pointerEvent(int buttonMask, int x, int y, rfbClientPtr cl);
 
-    /* @brief Re-opens USB device in case the endpoint shutdown */
-    void restart();
     /* @brief Sends a wakeup data packet to the USB input device */
     void sendWakeupPacket();
     /* @brief Sends an HID report to the USB input device */
@@ -90,8 +88,6 @@
     bool writeKeyboard(const uint8_t *report);
     void writePointer(const uint8_t *report);
 
-    /* @brief Indicates whether or not a pointer report error has occurred */
-    bool pointerError;
     /* @brief Indicates whether or not to send a keyboard report */
     bool sendKeyboard;
     /* @brief Indicates whether or not to send a pointer report */
diff --git a/ikvm_video.cpp b/ikvm_video.cpp
index 6a5aa6c..7bd4b4e 100644
--- a/ikvm_video.cpp
+++ b/ikvm_video.cpp
@@ -163,10 +163,9 @@
         restart();
         return false;
     }
-    else if (timingsError)
+    else
     {
         timingsError = false;
-        input.restart();
     }
 
     if (timings.bt.width != width || timings.bt.height != height)
