From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23DBC156F30; Tue, 30 Jul 2024 17:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722358882; cv=none; b=Ay1hacyLL/qB5VLtwhOCYr22DC8gIl8rZaQghOdhaZQiTFS24PMJnfomJfP7TPnwwWHtWE1QM2aWqBwlwW6HfFqNyjKoEBV1wWRrqC1cgrEdGFjQr8jYtbj3GFv8sTh8fCN6Nvjyw5REpCut8n7Kkm+mOTFD/HL5elF4lD1BNFs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722358882; c=relaxed/simple; bh=aMR8BXxnWvIe8CUxwNlwdjTg10hLJPAEUU9gqKozXwE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XltBL8NMd6qZwj0FC0yy7IJixMyfqFeunG4lgYLq7lv2IbPZLFlnrZfL228BdXOIKrkXUXrwXPHrMye8GMChW2sHmSY/hlB0A2AG9xy/iP3ZNXB2hSJhfz7JQqOcUgW1lQIWzgUIuceduf8FkBbT1jMbdCIKGz3ZnIm0p+xueyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SNDhzOQR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SNDhzOQR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52F34C32782; Tue, 30 Jul 2024 17:01:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722358882; bh=aMR8BXxnWvIe8CUxwNlwdjTg10hLJPAEUU9gqKozXwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SNDhzOQRDpcxwu6298+o0SFFzy2w/T1j+IcsEGgcB5tA0MsUKUL5b2n7hd4guUhLv 6K0TxZijwjObTvSeDyJW8rT+qshzItbtWF4XS7+OArDMn6l00jaCKPrvAf+IsYN6he Y0WvRJlFcloUvp7to9TdxKlewdZh5oWxMTqwVhW0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Lee Jones Subject: [PATCH 6.6 405/568] leds: ss4200: Convert PCIBIOS_* return codes to errnos Date: Tue, 30 Jul 2024 17:48:32 +0200 Message-ID: <20240730151655.700440694@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730151639.792277039@linuxfoundation.org> References: <20240730151639.792277039@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ilpo Järvinen commit ce068e83976140badb19c7f1307926b4b562fac4 upstream. ich7_lpc_probe() uses pci_read_config_dword() that returns PCIBIOS_* codes. The error handling code assumes incorrectly it's a normal errno and checks for < 0. The return code is returned from the probe function as is but probe functions should return normal errnos. Remove < 0 from the check and convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it. Fixes: a328e95b82c1 ("leds: LED driver for Intel NAS SS4200 series (v5)") Cc: Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20240527132700.14260-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Lee Jones Signed-off-by: Greg Kroah-Hartman --- drivers/leds/leds-ss4200.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/leds/leds-ss4200.c +++ b/drivers/leds/leds-ss4200.c @@ -356,8 +356,10 @@ static int ich7_lpc_probe(struct pci_dev nas_gpio_pci_dev = dev; status = pci_read_config_dword(dev, PMBASE, &g_pm_io_base); - if (status) + if (status) { + status = pcibios_err_to_errno(status); goto out; + } g_pm_io_base &= 0x00000ff80; status = pci_read_config_dword(dev, GPIO_CTRL, &gc); @@ -369,8 +371,9 @@ static int ich7_lpc_probe(struct pci_dev } status = pci_read_config_dword(dev, GPIO_BASE, &nas_gpio_io_base); - if (0 > status) { + if (status) { dev_info(&dev->dev, "Unable to read GPIOBASE.\n"); + status = pcibios_err_to_errno(status); goto out; } dev_dbg(&dev->dev, ": GPIOBASE = 0x%08x\n", nas_gpio_io_base);