From patchwork Fri Dec 1 15:06:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 13475948 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ie9oTb3c" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F060F170E for ; Fri, 1 Dec 2023 07:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701443161; x=1732979161; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=894Vsxx0y1Q10HLL7y3coEcqiF1gDHzFItD8bLrT3ps=; b=ie9oTb3c5D72zBYE1zBc5brYAShfJFftbjNlqAhUEUElmocgH1oIdpna ztkkpMKdZYkP3p3iNAuEY4cNjZkRkZWAIKeqSYWNXLFYM5Fa0C+gT7b5r sYEfyofZQ2f8TA9rtqd2Ge9mQhKuMf6G4RnK5uAzdD4H9WjwtlfSI7brX x8k7x3UbFi+drbg4kUf/2LsbgVmBaGaR0Whk6F7Lr9tbgEpucrNwWSSQH fzHwlboGAdK9AcDEVJdtH8xsmC4hlUWL5zWbTQnhwbQVvvm/9H9flLBAi 9+YoTsE345i8YiV5PRG2BdiJt6glMUPzFBeJkWcRghvuZaK57FyVSQhl5 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="396309746" X-IronPort-AV: E=Sophos;i="6.04,241,1695711600"; d="scan'208";a="396309746" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2023 07:06:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10911"; a="943112593" X-IronPort-AV: E=Sophos;i="6.04,241,1695711600"; d="scan'208";a="943112593" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by orsmga005.jf.intel.com with ESMTP; 01 Dec 2023 07:05:59 -0800 From: Mathias Nyman To: Cc: , Niklas Neronin , Mathias Nyman Subject: [PATCH 11/19] xhci: check if legacy irq is available before using it as fallback Date: Fri, 1 Dec 2023 17:06:39 +0200 Message-Id: <20231201150647.1307406-12-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231201150647.1307406-1-mathias.nyman@linux.intel.com> References: <20231201150647.1307406-1-mathias.nyman@linux.intel.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Niklas Neronin Move the error check "No MSI-X/MSI found and no IRQ in BIOS" inside 'goto legacy'. It is better to check if the IRQ interrupt is available, before trying to add a handler. Additionally the aforementioned error message is much more clear. Signed-off-by: Niklas Neronin Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 95ed9404f6f8..7f2b1312e943 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -228,12 +228,12 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) return 0; } +legacy_irq: if (!pdev->irq) { xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n"); return -EINVAL; } - legacy_irq: if (!strlen(hcd->irq_descr)) snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", hcd->driver->description, hcd->self.busnum);