summaryrefslogtreecommitdiff
path: root/drivers/vfio/mdev/mdev_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vfio/mdev/mdev_sysfs.c')
-rw-r--r--drivers/vfio/mdev/mdev_sysfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
index 18114f3e090a..bcfe48d56e8a 100644
--- a/drivers/vfio/mdev/mdev_sysfs.c
+++ b/drivers/vfio/mdev/mdev_sysfs.c
@@ -67,7 +67,7 @@ static ssize_t create_store(struct kobject *kobj, struct device *dev,
if (ret)
return ret;
- ret = mdev_device_create(kobj, dev, &uuid);
+ ret = mdev_device_create(to_mdev_type(kobj), &uuid);
if (ret)
return ret;
@@ -249,8 +249,9 @@ static const struct attribute *mdev_device_attrs[] = {
NULL,
};
-int mdev_create_sysfs_files(struct mdev_device *mdev, struct mdev_type *type)
+int mdev_create_sysfs_files(struct mdev_device *mdev)
{
+ struct mdev_type *type = mdev->type;
struct kobject *kobj = &mdev->dev.kobj;
int ret;
@@ -271,15 +272,15 @@ int mdev_create_sysfs_files(struct mdev_device *mdev, struct mdev_type *type)
create_files_failed:
sysfs_remove_link(kobj, "mdev_type");
type_link_failed:
- sysfs_remove_link(type->devices_kobj, dev_name(&mdev->dev));
+ sysfs_remove_link(mdev->type->devices_kobj, dev_name(&mdev->dev));
return ret;
}
-void mdev_remove_sysfs_files(struct mdev_device *mdev, struct mdev_type *type)
+void mdev_remove_sysfs_files(struct mdev_device *mdev)
{
struct kobject *kobj = &mdev->dev.kobj;
sysfs_remove_files(kobj, mdev_device_attrs);
sysfs_remove_link(kobj, "mdev_type");
- sysfs_remove_link(type->devices_kobj, dev_name(&mdev->dev));
+ sysfs_remove_link(mdev->type->devices_kobj, dev_name(&mdev->dev));
}