Skip to content

Commit c1593dd

Browse files
chenhuacaibjorn-helgaas
authored andcommitted
PCI/VGA: Move vga_arb_integrated_gpu() earlier in file
Move vga_arb_integrated_gpu() earlier in file to prepare for future patch. No functional change intended. [bhelgaas: pull #ifdefs inside function] Link: https://lore.kernel.org/r/20211015061512.2941859-3-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20220224224753.297579-3-helgaas@kernel.org Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 1d38fe6 commit c1593dd

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

drivers/pci/vgaarb.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,17 @@ void vga_put(struct pci_dev *pdev, unsigned int rsrc)
565565
}
566566
EXPORT_SYMBOL(vga_put);
567567

568+
static bool vga_arb_integrated_gpu(struct device *dev)
569+
{
570+
#if defined(CONFIG_ACPI)
571+
struct acpi_device *adev = ACPI_COMPANION(dev);
572+
573+
return adev && !strcmp(acpi_device_hid(adev), ACPI_VIDEO_HID);
574+
#else
575+
return false;
576+
#endif
577+
}
578+
568579
/*
569580
* Rules for using a bridge to control a VGA descendant decoding: if a bridge
570581
* has only one VGA descendant then it can be used to control the VGA routing
@@ -1430,20 +1441,6 @@ static struct miscdevice vga_arb_device = {
14301441
MISC_DYNAMIC_MINOR, "vga_arbiter", &vga_arb_device_fops
14311442
};
14321443

1433-
#if defined(CONFIG_ACPI)
1434-
static bool vga_arb_integrated_gpu(struct device *dev)
1435-
{
1436-
struct acpi_device *adev = ACPI_COMPANION(dev);
1437-
1438-
return adev && !strcmp(acpi_device_hid(adev), ACPI_VIDEO_HID);
1439-
}
1440-
#else
1441-
static bool vga_arb_integrated_gpu(struct device *dev)
1442-
{
1443-
return false;
1444-
}
1445-
#endif
1446-
14471444
static void __init vga_arb_select_default_device(void)
14481445
{
14491446
struct pci_dev *pdev, *found = NULL;

0 commit comments

Comments
 (0)