diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp
index a0d269fef7f4..096f9649bfc9 100644
--- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp
+++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp
@@ -6,7 +6,6 @@
  */
 
 #include <iostream>
-#include <sys/stat.h>
 
 #include <linux/media-bus-format.h>
 
@@ -18,16 +17,6 @@
 using namespace std;
 using namespace libcamera;
 
-bool exists(const std::string &path)
-{
-	struct stat sb;
-
-	if (stat(path.c_str(), &sb) == 0)
-		return true;
-
-	return false;
-}
-
 int V4L2VideoDeviceTest::init()
 {
 	enumerator_ = DeviceEnumerator::create();
