diff --git a/src/libcamera/sysfs.cpp b/src/libcamera/sysfs.cpp
index 3ebe66f8d69b61d4..e9004b2b59c8638d 100644
--- a/src/libcamera/sysfs.cpp
+++ b/src/libcamera/sysfs.cpp
@@ -70,10 +70,11 @@ std::string charDevPath(const std::string &deviceNode)
 std::string firmwareNodePath(const std::string &device)
 {
 	std::string fwPath, node;
+	struct stat st;
 
 	/* Lookup for DT-based systems */
 	node = device + "/of_node";
-	if (File::exists(node)) {
+	if (!stat(node.c_str(), &st)) {
 		char *ofPath = realpath(node.c_str(), nullptr);
 		if (!ofPath)
 			return {};
