platform/x86/intel/speed_select_if: Convert PCIBIOS_* return codes to errnos
Subsystems (2)
PATCH 1/1 platform/x86/intel/speed_select_if: Convert PCIBIOS_* return codes to errnos
isst_if_probe() uses pci_read_config_dword() that returns PCIBIOS_* codes. The return code is returned from the probe function as is but probe functions should return normal errnos. A proper implementation can be found in drivers/leds/leds-ss4200.c.
Convert PCIBIOS_* return codes using pcibios_err_to_errno() into normal errno before returning.
--- drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c +2 -2
@@ -108,11 +108,11 @@ static int isst_if_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ret =pci_read_config_dword (pdev,0xD0 , &mmio_base);if (ret) -return ret; +return pcibios_err_to_errno (ret); ret =pci_read_config_dword (pdev,0xFC , &pcu_base);if (ret) -return ret; +return pcibios_err_to_errno (ret); pcu_base &=GENMASK (10 ,0 ); base_addr = (u64 )mmio_base <<23 | (u64 ) pcu_base <<12 ;
Signature · 1 line
2.50.1.windows.1
Quoted 11 lines · Haotian Zhang
isst_if_probe()usespci_read_config_dword()that returns PCIBIOS_* codes. The return code is returned from the probe function as is but probe functions should return normal errnos. A proper implementation can be found indrivers/leds/leds-ss4200.c.Convert PCIBIOS_* return codes using
pcibios_err_to_errno()into normal errno before returning.Fixes d3a23584294c ("platform/x86: ISST: Add Intel Speed Select mmiointerface")
Signed-off-by Haotian Zhang <[email protected]>
Quoted 25 lines
---
drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)diff --git
a/drivers/platform/x86/intel/speed_select_if/isst_if_mmio.cb/drivers/platform/x86/intel/speed_select_if/isst_if_mmio.cindex3f4343147dad..950ede5eab76100644drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c +0
-0@@ -108,11 +108,11 @@ static int isst_if_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ret =pci_read_config_dword(pdev, 0xD0, &mmio_base); if (ret)drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c +1
-1-return ret; +return pcibios_err_to_errno (ret);
ret =pci_read_config_dword(pdev, 0xFC, &pcu_base); if (ret)drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c +1
-1-return ret; +return pcibios_err_to_errno (ret);
pcu_base&=GENMASK(10, 0);
base_addr= (u64)mmio_base << 23 | (u64)pcu_base<< 12;
Ilpo Järvinen
maintainerQuoted 9 lines · Haotian Zhang
isst_if_probe()usespci_read_config_dword()that returns PCIBIOS_* codes. The return code is returned from the probe function as is but probe functions should return normal errnos. A proper implementation can be found indrivers/leds/leds-ss4200.c.Convert PCIBIOS_* return codes using
pcibios_err_to_errno()into normal errno before returning.[...]
Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86/intel/speed_select_if: Convert PCIBIOS_* return codes to errnos
commit: d8bb447efc5622577994287dc77c684fa8840b30
--
i.