aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSui Jingfeng <[email protected]>2023-08-30 19:15:31 +0800
committerBjorn Helgaas <[email protected]>2023-10-06 17:19:01 -0500
commit76432cf63e2f56df23bf72c1ef9e1b3ef87a05d7 (patch)
treeb761a0ef517202cb9b311cdab83c8d685e5c0813
parentcdd3cecb521520ff316eea5ee36608b63a8df9f9 (diff)
drm/virtio: Use pci_is_vga() to identify VGA devices
Use pci_is_vga() to identify VGA devices instead of open-coding the class test. This means virtio_gpu_pci_quirk() will apply to old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as the PCI_CLASS_DISPLAY_VGA (0x0300) devices it did previously. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sui Jingfeng <[email protected]> [bhelgaas: commit log] Signed-off-by: Bjorn Helgaas <[email protected]> Cc: David Airlie <[email protected]> Cc: Gerd Hoffmann <[email protected]> Cc: Gurchetan Singh <[email protected]> Cc: Chia-I Wu <[email protected]> Cc: Daniel Vetter <[email protected]>
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_drv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index 644b8ee51009..4334c7608408 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -51,7 +51,7 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
const char *pname = dev_name(&pdev->dev);
- bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
+ bool vga = pci_is_vga(pdev);
int ret;
DRM_INFO("pci: %s detected at %s\n",