]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/platform: Use open_device() instead of open coding a refcnt scheme
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 6 Aug 2021 01:19:03 +0000 (22:19 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 11 Aug 2021 15:50:11 +0000 (09:50 -0600)
commitfe1e15e5494fdb9ba964853abe80812aed9e22ea
treeb894176e74ab550ba7048b0350f5d4203cdfbd8c
parent6ea9d0b3d5ff4cf065e2452c1f83ca1ee3fc2a27
vfio/platform: Use open_device() instead of open coding a refcnt scheme

Platform simply wants to run some code when the device is first
opened/last closed. Use the core framework and locking for this.  Aside
from removing a bit of code this narrows the locking scope from a global
lock.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/7-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/platform/vfio_platform_common.c
drivers/vfio/platform/vfio_platform_private.h