RE: [PATCH] vfio: platform: ignore missing reset if disabled at module init

From: Tian, Kevin
Date: Mon Jan 30 2023 - 04:05:46 EST


> From: Tomasz Duszynski <tduszynski@xxxxxxxxxxx>
> Sent: Thursday, January 26, 2023 12:11 AM
> @@ -653,7 +653,8 @@ int vfio_platform_init_common(struct
> vfio_platform_device *vdev)
> if (ret && vdev->reset_required)
> dev_err(dev, "No reset function found for device %s\n",
> vdev->name);
> - return ret;
> +
> + return vdev->reset_required ? ret : 0;
> }
> EXPORT_SYMBOL_GPL(vfio_platform_init_common);

It reads slightly better to me as below:

if (ret & vdev->reset_required) {
dev_err(...);
return ret;
}

return 0;