mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 20:35:23 +02:00
mmc: sdhci-pci: Convert PCIBIOS_* return codes to errnos
commitebc4fc34ea
upstream. jmicron_pmos() and sdhci_pci_probe() use pci_{read,write}_config_byte() that return PCIBIOS_* codes. The return code is then returned as is by jmicron_probe() and sdhci_pci_probe(). Similarly, the return code is also returned as is from jmicron_resume(). Both probe and resume functions should return normal errnos. Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning them the fix these issues. Fixes:7582041ff3
("mmc: sdhci-pci: fix simple_return.cocci warnings") Fixes:45211e2159
("sdhci: toggle JMicron PMOS setting") Cc: stable@vger.kernel.org Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20240527132443.14038-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
485d942171
commit
006e04ae96
|
@ -1325,7 +1325,7 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on)
|
||||||
|
|
||||||
ret = pci_read_config_byte(chip->pdev, 0xAE, &scratch);
|
ret = pci_read_config_byte(chip->pdev, 0xAE, &scratch);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto fail;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Turn PMOS on [bit 0], set over current detection to 2.4 V
|
* Turn PMOS on [bit 0], set over current detection to 2.4 V
|
||||||
|
@ -1336,7 +1336,10 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on)
|
||||||
else
|
else
|
||||||
scratch &= ~0x47;
|
scratch &= ~0x47;
|
||||||
|
|
||||||
return pci_write_config_byte(chip->pdev, 0xAE, scratch);
|
ret = pci_write_config_byte(chip->pdev, 0xAE, scratch);
|
||||||
|
|
||||||
|
fail:
|
||||||
|
return pcibios_err_to_errno(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int jmicron_probe(struct sdhci_pci_chip *chip)
|
static int jmicron_probe(struct sdhci_pci_chip *chip)
|
||||||
|
@ -2201,7 +2204,7 @@ static int sdhci_pci_probe(struct pci_dev *pdev,
|
||||||
|
|
||||||
ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
|
ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return pcibios_err_to_errno(ret);
|
||||||
|
|
||||||
slots = PCI_SLOT_INFO_SLOTS(slots) + 1;
|
slots = PCI_SLOT_INFO_SLOTS(slots) + 1;
|
||||||
dev_dbg(&pdev->dev, "found %d slot(s)\n", slots);
|
dev_dbg(&pdev->dev, "found %d slot(s)\n", slots);
|
||||||
|
@ -2210,7 +2213,7 @@ static int sdhci_pci_probe(struct pci_dev *pdev,
|
||||||
|
|
||||||
ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &first_bar);
|
ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &first_bar);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return pcibios_err_to_errno(ret);
|
||||||
|
|
||||||
first_bar &= PCI_SLOT_INFO_FIRST_BAR_MASK;
|
first_bar &= PCI_SLOT_INFO_FIRST_BAR_MASK;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user