diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index e1ae34f88455..2d493e6c895f 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -231,10 +231,10 @@ int MediaDevice::populate()
 	 */
 	while (true) {
 		topology.topology_version = 0;
-		topology.ptr_entities = reinterpret_cast<__u64>(ents);
-		topology.ptr_interfaces = reinterpret_cast<__u64>(interfaces);
-		topology.ptr_links = reinterpret_cast<__u64>(links);
-		topology.ptr_pads = reinterpret_cast<__u64>(pads);
+		topology.ptr_entities = reinterpret_cast<std::uintptr_t>(ents);
+		topology.ptr_interfaces = reinterpret_cast<std::uintptr_t>(interfaces);
+		topology.ptr_links = reinterpret_cast<std::uintptr_t>(links);
+		topology.ptr_pads = reinterpret_cast<std::uintptr_t>(pads);
 
 		ret = ioctl(fd_, MEDIA_IOC_G_TOPOLOGY, &topology);
 		if (ret < 0) {
