summaryrefslogtreecommitdiff
path: root/include/linux/mdev.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2022-04-11 17:14:01 +0300
committerZhi Wang <zhi.a.wang@intel.com>2022-04-21 14:36:56 +0300
commit6b42f491e17ce13f5ff7f2d1f49c73a0f4c47b20 (patch)
treed95f75eb0e8101b4d0c1fbe7287a9ee3013749f8 /include/linux/mdev.h
parente6486939d8ea22569af942a1888aa3824f59cc5e (diff)
downloadlinux-6b42f491e17ce13f5ff7f2d1f49c73a0f4c47b20.tar.xz
vfio/mdev: Remove mdev_parent_ops
The last useful member in this struct is the supported_type_groups, move it to the mdev_driver and delete mdev_parent_ops. Replace it with mdev_driver as an argument to mdev_register_device() Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-33-hch@lst.de Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com> Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
Diffstat (limited to 'include/linux/mdev.h')
-rw-r--r--include/linux/mdev.h25
1 files changed, 4 insertions, 21 deletions
diff --git a/include/linux/mdev.h b/include/linux/mdev.h
index 69df1fa2cb6f..1f6f57a3c316 100644
--- a/include/linux/mdev.h
+++ b/include/linux/mdev.h
@@ -30,26 +30,6 @@ unsigned int mdev_get_type_group_id(struct mdev_device *mdev);
unsigned int mtype_get_type_group_id(struct mdev_type *mtype);
struct device *mtype_get_parent_dev(struct mdev_type *mtype);
-/**
- * struct mdev_parent_ops - Structure to be registered for each parent device to
- * register the device to mdev module.
- *
- * @owner: The module owner.
- * @device_driver: Which device driver to probe() on newly created devices
- * @mdev_attr_groups: Attributes of the mediated device.
- * @supported_type_groups: Attributes to define supported types. It is mandatory
- * to provide supported types.
- *
- * Parent device that support mediated device should be registered with mdev
- * module with mdev_parent_ops structure.
- **/
-struct mdev_parent_ops {
- struct module *owner;
- struct mdev_driver *device_driver;
- const struct attribute_group **mdev_attr_groups;
- struct attribute_group **supported_type_groups;
-};
-
/* interface for exporting mdev supported type attributes */
struct mdev_type_attribute {
struct attribute attr;
@@ -74,12 +54,15 @@ struct mdev_type_attribute mdev_type_attr_##_name = \
* struct mdev_driver - Mediated device driver
* @probe: called when new device created
* @remove: called when device removed
+ * @supported_type_groups: Attributes to define supported types. It is mandatory
+ * to provide supported types.
* @driver: device driver structure
*
**/
struct mdev_driver {
int (*probe)(struct mdev_device *dev);
void (*remove)(struct mdev_device *dev);
+ struct attribute_group **supported_type_groups;
struct device_driver driver;
};
@@ -98,7 +81,7 @@ static inline const guid_t *mdev_uuid(struct mdev_device *mdev)
extern struct bus_type mdev_bus_type;
-int mdev_register_device(struct device *dev, const struct mdev_parent_ops *ops);
+int mdev_register_device(struct device *dev, struct mdev_driver *mdev_driver);
void mdev_unregister_device(struct device *dev);
int mdev_register_driver(struct mdev_driver *drv);