Skip to content

Commit 76432cf

Browse files
Sui Jingfengbjorn-helgaas
authored andcommitted
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]>
1 parent cdd3cec commit 76432cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/virtio/virtgpu_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int virtio_gpu_pci_quirk(struct drm_device *dev)
5151
{
5252
struct pci_dev *pdev = to_pci_dev(dev->dev);
5353
const char *pname = dev_name(&pdev->dev);
54-
bool vga = (pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA;
54+
bool vga = pci_is_vga(pdev);
5555
int ret;
5656

5757
DRM_INFO("pci: %s detected at %s\n",

0 commit comments

Comments
 (0)