diff options
author | Huacai Chen <chenhuacai@loongson.cn> | 2022-02-24 16:47:44 -0600 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2022-03-09 18:30:48 -0600 |
commit | c1593ddd894d0518fc96fe7f531f3a5c919b8463 (patch) | |
tree | c68b05a0f66fb9bf75801f5d4511d12d392c8358 /drivers/pci | |
parent | 1d38fe6ee6a874675ca3bba6b48e69a0e6176ffc (diff) |
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/vgaarb.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index 8320385a487b..6c57ffb77770 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -565,6 +565,17 @@ bail: } EXPORT_SYMBOL(vga_put); +static bool vga_arb_integrated_gpu(struct device *dev) +{ +#if defined(CONFIG_ACPI) + struct acpi_device *adev = ACPI_COMPANION(dev); + + return adev && !strcmp(acpi_device_hid(adev), ACPI_VIDEO_HID); +#else + return false; +#endif +} + /* * Rules for using a bridge to control a VGA descendant decoding: if a bridge * 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 = { MISC_DYNAMIC_MINOR, "vga_arbiter", &vga_arb_device_fops }; -#if defined(CONFIG_ACPI) -static bool vga_arb_integrated_gpu(struct device *dev) -{ - struct acpi_device *adev = ACPI_COMPANION(dev); - - return adev && !strcmp(acpi_device_hid(adev), ACPI_VIDEO_HID); -} -#else -static bool vga_arb_integrated_gpu(struct device *dev) -{ - return false; -} -#endif - static void __init vga_arb_select_default_device(void) { struct pci_dev *pdev, *found = NULL; |