mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 07:34:12 +08:00
vfio/mdev: remove mdev_from_dev
Just open code it in the only caller. 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-7-hch@lst.de Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
da44c340c4
commit
cbf3bb28aa
@ -53,10 +53,8 @@ static void mdev_device_remove_common(struct mdev_device *mdev)
|
|||||||
|
|
||||||
static int mdev_device_remove_cb(struct device *dev, void *data)
|
static int mdev_device_remove_cb(struct device *dev, void *data)
|
||||||
{
|
{
|
||||||
struct mdev_device *mdev = mdev_from_dev(dev);
|
if (dev->bus == &mdev_bus_type)
|
||||||
|
mdev_device_remove_common(to_mdev_device(dev));
|
||||||
if (mdev)
|
|
||||||
mdev_device_remove_common(mdev);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,9 +102,5 @@ static inline struct device *mdev_dev(struct mdev_device *mdev)
|
|||||||
{
|
{
|
||||||
return &mdev->dev;
|
return &mdev->dev;
|
||||||
}
|
}
|
||||||
static inline struct mdev_device *mdev_from_dev(struct device *dev)
|
|
||||||
{
|
|
||||||
return dev->bus == &mdev_bus_type ? to_mdev_device(dev) : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* MDEV_H */
|
#endif /* MDEV_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user