]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/vfio/pci/vfio_pci_core.c
Merge tag 'vfio-v5.15-rc1' of git://github.com/awilliam/linux-vfio
[mirror_ubuntu-jammy-kernel.git] / drivers / vfio / pci / vfio_pci_core.c
index 675616e08897195663bf4f49fe1c6ef11cbbe0a7..68198e0f2a63106bd345dc8e1ffb8d27bbe49555 100644 (file)
@@ -53,10 +53,9 @@ static inline bool vfio_vga_disabled(void)
  * has no way to get to it and routing can be disabled externally at the
  * bridge.
  */
-static unsigned int vfio_pci_set_vga_decode(void *opaque, bool single_vga)
+static unsigned int vfio_pci_set_decode(struct pci_dev *pdev, bool single_vga)
 {
-       struct vfio_pci_core_device *vdev = opaque;
-       struct pci_dev *tmp = NULL, *pdev = vdev->pdev;
+       struct pci_dev *tmp = NULL;
        unsigned char max_busnr;
        unsigned int decodes;
 
@@ -1756,10 +1755,10 @@ static int vfio_pci_vga_init(struct vfio_pci_core_device *vdev)
        if (!vfio_pci_is_vga(pdev))
                return 0;
 
-       ret = vga_client_register(pdev, vdev, NULL, vfio_pci_set_vga_decode);
+       ret = vga_client_register(pdev, vfio_pci_set_decode);
        if (ret)
                return ret;
-       vga_set_legacy_decoding(pdev, vfio_pci_set_vga_decode(vdev, false));
+       vga_set_legacy_decoding(pdev, vfio_pci_set_decode(pdev, false));
        return 0;
 }
 
@@ -1769,7 +1768,7 @@ static void vfio_pci_vga_uninit(struct vfio_pci_core_device *vdev)
 
        if (!vfio_pci_is_vga(pdev))
                return;
-       vga_client_register(pdev, NULL, NULL, NULL);
+       vga_client_unregister(pdev);
        vga_set_legacy_decoding(pdev, VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM |
                                              VGA_RSRC_LEGACY_IO |
                                              VGA_RSRC_LEGACY_MEM);