From patchwork Mon May 27 13:25:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13675257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13C5FC25B74 for ; Mon, 27 May 2024 13:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BJhqDvsItcbmJlxIty+NrsU4iGLfT+bXRc+/xYLLyU4=; b=TBuuCPN8wDM41X Wtyx1lSdQYqwicyXzjpYimhXbL+tn/2QxTwvDLkzEunsDjl4fH8NzhfW3PezTsy8473l+dc43E71v oXbvGpPl16NeaveH3Lc+aL6nr8M5uUnmUXi3wrR2sVcM7nhur97xuZeCGJhXRuUY6UxHD+PTFoCc1 ROVDNniyIryP0UEmDDavlPf2S9PXKAl19lGV7cqkM/tFeMQQiYOt9VHaNUGoQ5gyJqQbEe+ncyOCv Rx1HAVuRembIzUe4l3xiGL/y60N9YORW01IUXJhaDdcEV8olvtfgYXnpXvTeEWTax5dlbyHCpOnlI stbKN5AJ1U3qL1r+1r6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBaMc-0000000F4io-359S; Mon, 27 May 2024 13:26:10 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBaMW-0000000F4gj-3qBo for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2024 13:26:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716816365; x=1748352365; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=A7OKadLaoCRz5R/qj8fiyIi+G0M1yoSql7UbDHY+5UY=; b=eVNAs7+v97hiRb8z6MxcSWH1pSL5EGTiLCQufFpfrUj2NckENZQNOhyj giDDr4LQ7KsSmKIxUsxJwrBfADtHdRXXtDLLlmvgxSg0Kc+swiuNL30Fd L/4ErH6WL7qAQz1n7RQmEp4o6xuBwRba2A9vfmP1FsBPje7FY1drYAjsM +5j1qFJqGEpA8rFjDbLkoVbHp5kL02zw8mmaXtmfZh7Bjv7A8dAiPRNoj 9BDGyzuXaGzTC61OxQl57aCEDzoYRxy7Fu+1WMFeRs1cjJDrxk4LYzVVD UXYjCmeeTteBe97Jer5nl8DPMY3ThDkom5dX2sPUYoO0cPS0pxeAgOS0o w==; X-CSE-ConnectionGUID: nCZuicC9Q024CP96J7yHqw== X-CSE-MsgGUID: HpaTWPCXSweKvviVUOwXRg== X-IronPort-AV: E=McAfee;i="6600,9927,11084"; a="38520283" X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="38520283" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 06:26:03 -0700 X-CSE-ConnectionGUID: 8oR2m5pISKebTliMcOv3GQ== X-CSE-MsgGUID: /4BWKaQbQue2aftMKpOPhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,192,1712646000"; d="scan'208";a="39206633" Received: from unknown (HELO localhost) ([10.245.247.140]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 06:25:59 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Marcel Holtmann , Luiz Augusto von Dentz , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= , stable@vger.kernel.org Subject: [PATCH 1/1] Bluetooth: hci_bcm4377: Convert PCIBIOS_* return codes to errnos Date: Mon, 27 May 2024 16:25:51 +0300 Message-Id: <20240527132552.14119-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240527_062604_991169_E4DF5B00 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org bcm4377_init_cfg() uses pci_{read,write}_config_dword() that return PCIBIOS_* codes. The return codes are returned into the calling bcm4377_probe() which directly returns the error which is of incorrect type (a probe should return normal errnos). Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it from bcm4377_init_cfg. This conversion is the easiest by adding a label next to return and doing the conversion there once rather than adding pcibios_err_to_errno() into every single return statement. Fixes: 8a06127602de ("Bluetooth: hci_bcm4377: Add new driver for BCM4377 PCIe boards") Cc: stable@vger.kernel.org Signed-off-by: Ilpo Järvinen --- drivers/bluetooth/hci_bcm4377.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 0c2f15235b4c..b00240109dc3 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -2134,44 +2134,46 @@ static int bcm4377_init_cfg(struct bcm4377_data *bcm4377) BCM4377_PCIECFG_BAR0_WINDOW1, bcm4377->hw->bar0_window1); if (ret) - return ret; + goto fail; ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR0_WINDOW2, bcm4377->hw->bar0_window2); if (ret) - return ret; + goto fail; ret = pci_write_config_dword( bcm4377->pdev, BCM4377_PCIECFG_BAR0_CORE2_WINDOW1, BCM4377_PCIECFG_BAR0_CORE2_WINDOW1_DEFAULT); if (ret) - return ret; + goto fail; if (bcm4377->hw->has_bar0_core2_window2) { ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR0_CORE2_WINDOW2, bcm4377->hw->bar0_core2_window2); if (ret) - return ret; + goto fail; } ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR2_WINDOW, BCM4377_PCIECFG_BAR2_WINDOW_DEFAULT); if (ret) - return ret; + goto fail; ret = pci_read_config_dword(bcm4377->pdev, BCM4377_PCIECFG_SUBSYSTEM_CTRL, &ctrl); if (ret) - return ret; + goto fail; if (bcm4377->hw->clear_pciecfg_subsystem_ctrl_bit19) ctrl &= ~BIT(19); ctrl |= BIT(16); - return pci_write_config_dword(bcm4377->pdev, - BCM4377_PCIECFG_SUBSYSTEM_CTRL, ctrl); + ret = pci_write_config_dword(bcm4377->pdev, + BCM4377_PCIECFG_SUBSYSTEM_CTRL, ctrl); +fail: + return pcibios_err_to_errno(ret); } static int bcm4377_probe_dmi(struct bcm4377_data *bcm4377)