From patchwork Tue Jun 9 09:18:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Stankiewicz X-Patchwork-Id: 11594967 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F2D71391 for ; Tue, 9 Jun 2020 09:18:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E357220814 for ; Tue, 9 Jun 2020 09:18:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbgFIJSN (ORCPT ); Tue, 9 Jun 2020 05:18:13 -0400 Received: from mga17.intel.com ([192.55.52.151]:29572 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726923AbgFIJSM (ORCPT ); Tue, 9 Jun 2020 05:18:12 -0400 IronPort-SDR: Z5d1+haSMjlETTAcKIOWaAXAqsIajAckhdnZ1UHHpR0kVYeMoFmNygJg5ZJTbReuFoexNNvMtB j+b84vv2I47w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 02:18:12 -0700 IronPort-SDR: YEBS/z/G5nU6E9C+Avc8F212L2Mu+I76kyWXn+RbuvYJ3OTuVcZyOfKpBFFnIEAXkSVGuzbp+t ny+MYPhF0XRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,491,1583222400"; d="scan'208";a="274539027" Received: from gklab-125-110.igk.intel.com ([10.91.125.110]) by orsmga006.jf.intel.com with ESMTP; 09 Jun 2020 02:18:09 -0700 From: Piotr Stankiewicz To: Bjorn Helgaas , linux-pci@vger.kernel.org Cc: Piotr Stankiewicz , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Airlie , Daniel Vetter , Hawking Zhang , shaoyunl , Lyude Paul , Aurabindo Pillai , Sam Ravnborg , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 07/15] drm/amdgpu: Use PCI_IRQ_MSI_TYPES where appropriate Date: Tue, 9 Jun 2020 11:18:02 +0200 Message-Id: <20200609091804.1220-1-piotr.stankiewicz@intel.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20200609091148.32749-1-piotr.stankiewicz@intel.com> References: <20200609091148.32749-1-piotr.stankiewicz@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Seeing as there is shorthand available to use when asking for any type of interrupt, or any type of message signalled interrupt, leverage it. Signed-off-by: Piotr Stankiewicz Reviewed-by: Andy Shevchenko Acked-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c index 0cc4c67f95f7..97141aa81f32 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c @@ -248,17 +248,8 @@ int amdgpu_irq_init(struct amdgpu_device *adev) adev->irq.msi_enabled = false; if (amdgpu_msi_ok(adev)) { - int nvec = pci_msix_vec_count(adev->pdev); - unsigned int flags; - - if (nvec <= 0) { - flags = PCI_IRQ_MSI; - } else { - flags = PCI_IRQ_MSI | PCI_IRQ_MSIX; - } /* we only need one vector */ - nvec = pci_alloc_irq_vectors(adev->pdev, 1, 1, flags); - if (nvec > 0) { + if (pci_alloc_irq_vectors(adev->pdev, 1, 1, PCI_IRQ_MSI_TYPES) > 0) { adev->irq.msi_enabled = true; dev_dbg(adev->dev, "using MSI/MSI-X.\n"); }