Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vfio/mdev: remove mdev_parent_dev

Just open code the dereferences in the only user.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Link: https://lore.kernel.org/r/20220923092652.100656-9-hch@lst.de
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Christoph Hellwig and committed by
Alex Williamson
062e720c 2815fe14

+1 -11
-3
Documentation/driver-api/vfio-mediated-device.rst
··· 200 200 201 201 sprintf(buf, "%s-%s", dev_driver_string(parent->dev), group->name); 202 202 203 - (or using mdev_parent_dev(mdev) to arrive at the parent device outside 204 - of the core mdev code) 205 - 206 203 * device_api 207 204 208 205 This attribute should show which device API is being created, for example,
+1 -1
drivers/gpu/drm/i915/gvt/kvmgt.c
··· 1488 1488 struct intel_vgpu_type *type = 1489 1489 container_of(mdev->type, struct intel_vgpu_type, type); 1490 1490 1491 - vgpu->gvt = kdev_to_i915(mdev_parent_dev(mdev))->gvt; 1491 + vgpu->gvt = kdev_to_i915(mdev->type->parent->dev)->gvt; 1492 1492 return intel_gvt_create_vgpu(vgpu, type->conf); 1493 1493 } 1494 1494
-6
drivers/vfio/mdev/mdev_core.c
··· 23 23 static LIST_HEAD(mdev_list); 24 24 static DEFINE_MUTEX(mdev_list_lock); 25 25 26 - struct device *mdev_parent_dev(struct mdev_device *mdev) 27 - { 28 - return mdev->type->parent->dev; 29 - } 30 - EXPORT_SYMBOL(mdev_parent_dev); 31 - 32 26 /* 33 27 * Used in mdev_type_attribute sysfs functions to return the parent struct 34 28 * device
-1
include/linux/mdev.h
··· 95 95 int mdev_register_driver(struct mdev_driver *drv); 96 96 void mdev_unregister_driver(struct mdev_driver *drv); 97 97 98 - struct device *mdev_parent_dev(struct mdev_device *mdev); 99 98 static inline struct device *mdev_dev(struct mdev_device *mdev) 100 99 { 101 100 return &mdev->dev;