Skip to content

Commit cdd3cec

Browse files
Sui Jingfengbjorn-helgaas
authored andcommitted
PCI/sysfs: Enable 'boot_vga' attribute via pci_is_vga()
Enable the 'boot_vga' sysfs attribute via pci_is_vga(). This exposes 'boot_vga' for old PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as for the PCI_CLASS_DISPLAY_VGA (0x0300) devices where it was previously exposed. 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: "Maciej W. Rozycki" <[email protected]>
1 parent 300bac9 commit cdd3cec

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/pci/pci-sysfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,11 +1551,10 @@ static umode_t pci_dev_attrs_are_visible(struct kobject *kobj,
15511551
struct device *dev = kobj_to_dev(kobj);
15521552
struct pci_dev *pdev = to_pci_dev(dev);
15531553

1554-
if (a == &dev_attr_boot_vga.attr)
1555-
if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
1556-
return 0;
1554+
if (a == &dev_attr_boot_vga.attr && pci_is_vga(pdev))
1555+
return a->mode;
15571556

1558-
return a->mode;
1557+
return 0;
15591558
}
15601559

15611560
static struct attribute *pci_dev_hp_attrs[] = {

0 commit comments

Comments
 (0)