From patchwork Mon Dec 4 10:45:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 750348 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="V6FxOANN" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9307F2 for ; Mon, 4 Dec 2023 02:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701686681; x=1733222681; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=894Vsxx0y1Q10HLL7y3coEcqiF1gDHzFItD8bLrT3ps=; b=V6FxOANN7Oadb4qexGAd0AP2W0vRExNpxnnD9rCP39OiPbJwVSx77qi5 N1COFI6p9hcxSV7mA9rjUA5/oZwRC9JCoZAMr8JJiYgJjOMpPKQOWmNmH L7OoALBK3XhBhtGMX7Jh5oXRBWiDwusUmzoPIwmQNvWom3pKRO/Hm7eeD lE9XwpR/MNzVZ24iCu2NmaDfRUB0Nxfp4bQs+1DXorgPf9MG7OUm0QFOE hl4ggzzxVjAKtbZiy5g5Jj5MPjlYPOqj5nhAwWSKH8vRjPsMaczGfJS3d gn87PlqkP9knvackV5XonjOP7B5Twu909D21WjjN2W+fdYGlGeUlc2RBN g==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="15260668" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="15260668" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 02:44:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="861338945" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="861338945" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 04 Dec 2023 02:44:38 -0800 From: Mathias Nyman To: Cc: , Niklas Neronin , Mathias Nyman Subject: [PATCH v2 10/18] xhci: check if legacy irq is available before using it as fallback Date: Mon, 4 Dec 2023 12:45:26 +0200 Message-Id: <20231204104534.1335903-11-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231204104534.1335903-1-mathias.nyman@linux.intel.com> References: <20231204104534.1335903-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);