@@ -269,10 +269,6 @@ static int __vfio_register_dev(struct vfio_device *device,
if (!device->dev_set)
vfio_assign_device_set(device, device);
- ret = dev_set_name(&device->device, "vfio%d", device->index);
- if (ret)
- return ret;
-
ret = vfio_device_set_group(device, type);
if (ret)
return ret;
@@ -281,6 +277,11 @@ static int __vfio_register_dev(struct vfio_device *device,
if (ret)
goto err_out;
+ ret = dev_set_name(&device->device, "%svfio%d",
+ device->noiommu ? "noiommu-" : "", device->index);
+ if (ret)
+ goto err_out;
+
ret = device_add(&device->device);
if (ret)
goto err_out;