nfo, &caps);
+	if (ret)
+		return ret;
 
-		ret = device->ops->get_region_info_caps(device, &info, &caps);
-		if (ret)
-			return ret;
-
-		if (caps.size) {
-			info.flags |= VFIO_REGION_INFO_FLAG_CAPS;
-			if (info.argsz < sizeof(info) + caps.size) {
-				info.argsz = sizeof(info) + caps.size;
-				info.cap_offset = 0;
-			} else {
-				vfio_info_cap_shift(&caps, sizeof(info));
-				if (copy_to_user(arg + 1, caps.buf,
-						 caps.size)) {
-					kfree(caps.buf);
-					return -EFAULT;
-				}
-				info.cap_offset = sizeof(info);
+	if (caps.size) {
+		info.flags |= VFIO_REGION_INFO_FLAG_CAPS;
+		if (info.argsz < sizeof(info) + caps.size) {
+			info.argsz = sizeof(info) + caps.size;
+			info.cap_offset = 0;
+		} else {
+			vfio_info_cap_shift(&caps, sizeof(info));
+			if (copy_to_user(arg + 1, caps.buf, caps.size)) {
+				kfree(caps.buf);
+				return -EFAULT;
 			}
-			kfree(caps.buf);
+			info.cap_offset = sizeof(info);
 		}
-
-		if (copy_to_user(arg, &info, minsz))
-			return -EFAULT;
-	} else if (device->ops->get_region_info) {
-		ret = device->ops->get_region_info(device, arg);
-		if (ret)
-			return ret;
-	} else {
-		return -EINVAL;
+		kfree(caps.buf);
 	}
 
+	if (copy_to_user(arg, &info, minsz))
+		return -EFAULT;
 	return 0;
 }
 
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 6311ddc837701d..8e1ddb48b9b54e 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -133,8 +133,6 @@ struct vfio_device_ops {
 			 size_t count, loff_t *size);
 	long	(*ioctl)(struct vfio_device *vdev, unsigned int cmd,
 			 unsigned long arg);
-	int	(*get_region_info)(struct vfio_device *vdev,
-				   struct vfio_region_info __user *arg);
 	int	(*get_region_info_caps)(struct vfio_device *vdev,
 					struct vfio_region_info *info,
 					struct vfio_info_cap *caps);
-- 
2.43.0[PATCH 22/22] vfio: Remove the get_region_info opJason Gunthorpe <jgg@nvidia.com> undefinedAlexander Gordeev <agordeev@linux.ibm.com>, David Airlie <airlied@gmail.com>, Alex Williamson <alex.williamson@redhat.com>, Ankit Agrawal <ankita@nvidia.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Brett Creeley <brett.creeley@amd.com>, dri-devel@lists.freedesktop.org, Eric Auger <eric.auger@redhat.com>, Eric Farman <farman@linux.ibm.com>, Giovanni Cabiddu <giovanni.cabiddu@intel.com>, Vasily Gorbik <gor@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, intel-gfx@lists.freedesktop.org, Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Kevin Tian <kevin.tian@intel.com>, kvm@vger.kernel.org, Kirti Wankhede <kwankhede@nvidia.com>, linux-s390@vger.kernel.org, Longfang Liu <liulongfang@huawei.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Nikhil Agarwal <nikhil.agarwal@amd.com>, Nipun Gupta <nipun.gupta@amd.com>, Peter Oberparleiter <oberpar@linux.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Pranjal Shrivastava <praan@google.com>, qat-linux@intel.com, Rodrigo Vivi <rodrigo.vivi@intel.com>, Simona Vetter <simona@ffwll.ch>, Shameer Kolothum <skolothumtho@nvidia.com>, Mostafa Saleh <smostafa@google.com>, Sven Schnelle <svens@linux.ibm.com>, Tvrtko Ursulin <tursulin@ursulin.net>, virtualization@lists.linux.dev, Vineeth Vijayan <vneethv@linux.ibm.com>, Yishai Hadas <yishaih@nvidia.com>, Zhenyu Wang <zhenyuw.linux@gmail.com>, Zhi Wang <zhi.wang.linux@gmail.com> undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefined undefinedÂsƒÃ/	