From patchwork Thu Jul 22 21:29:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 12394865 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0E66C4338F for ; Thu, 22 Jul 2021 21:29:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB9E360EB5 for ; Thu, 22 Jul 2021 21:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231946AbhGVUtE (ORCPT ); Thu, 22 Jul 2021 16:49:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:41486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbhGVUtE (ORCPT ); Thu, 22 Jul 2021 16:49:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F1B060C41; Thu, 22 Jul 2021 21:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626989378; bh=jzI4K0thGJA1hYgjMq9AeGLmE9HeNM6DZi9oIzIppys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/Cz/zr3klCDL8wPUjP5VrC4X/FslhOLTp7JbvxX+f0NBrSFiTiIEKOFbecMBGbtE ZOKxnjYy+XbsYdkEWspu64XXYlxq205X4H81mQnWKAl7CAjHeMeN85/4YMvJQOt4Hp +5Fb2gljR+gsviWyxROLE0evWIr0fnKBzp529KiypXrwW70THxu3BLfXQxNcPOMf9N i5mX7KWhsPIm7m0ABC1yiU+HFzgStMdWbueDYlPt/Ge0OSbn8C5a5azqQBCFAignl5 pUrPAavTxITT0v/jlSqxt5oowCIcGZ+KN2U51oWt02sft/dG3FNWUrPmgLJil3Krd6 +MfANMJEmrHhw== From: Bjorn Helgaas To: Huacai Chen Cc: David Airlie , Daniel Vetter , Xuefeng Li , Benjamin Herrenschmidt , dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, Bjorn Helgaas Subject: [PATCH v2 5/9] PCI/VGA: Move vga_arb_integrated_gpu() earlier in file Date: Thu, 22 Jul 2021 16:29:16 -0500 Message-Id: <20210722212920.347118-6-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722212920.347118-1-helgaas@kernel.org> References: <20210722212920.347118-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Huacai Chen Move vga_arb_integrated_gpu() earlier in file to prepare for future patch. No functional change intended. [bhelgaas: split to separate patch] Link: https://lore.kernel.org/r/20210705100503.1120643-1-chenhuacai@loongson.cn Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas --- drivers/pci/vgaarb.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index c984c76b3fd7..1f8fb37be5fa 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -563,6 +563,20 @@ void vga_put(struct pci_dev *pdev, unsigned int rsrc) } EXPORT_SYMBOL(vga_put); +#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 + /* * 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 @@ -1416,20 +1430,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;