public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	"Fengguang Wu" <fengguang.wu@intel.com>,
	"Pierre Ossman" <drzeus@drzeus.cx>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 1/2] mmc: sdhci-pci: Convert PCIBIOS_* return codes to errnos
Date: Mon, 3 Jun 2024 10:16:03 +0300	[thread overview]
Message-ID: <1f0b04a9-449b-423a-8f74-e6d2e463d6bb@intel.com> (raw)
In-Reply-To: <20240527132443.14038-1-ilpo.jarvinen@linux.intel.com>

On 27/05/24 16:24, Ilpo Järvinen wrote:
> 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: 7582041ff3d4 ("mmc: sdhci-pci: fix simple_return.cocci warnings")
> Fixes: 45211e215984 ("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>

> ---
>  drivers/mmc/host/sdhci-pci-core.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
> index ef89ec382bfe..23e6ba70144c 100644
> --- a/drivers/mmc/host/sdhci-pci-core.c
> +++ b/drivers/mmc/host/sdhci-pci-core.c
> @@ -1326,7 +1326,7 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on)
>  
>  	ret = pci_read_config_byte(chip->pdev, 0xAE, &scratch);
>  	if (ret)
> -		return ret;
> +		goto fail;
>  
>  	/*
>  	 * Turn PMOS on [bit 0], set over current detection to 2.4 V
> @@ -1337,7 +1337,10 @@ static int jmicron_pmos(struct sdhci_pci_chip *chip, int on)
>  	else
>  		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)
> @@ -2202,7 +2205,7 @@ static int sdhci_pci_probe(struct pci_dev *pdev,
>  
>  	ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
>  	if (ret)
> -		return ret;
> +		return pcibios_err_to_errno(ret);
>  
>  	slots = PCI_SLOT_INFO_SLOTS(slots) + 1;
>  	dev_dbg(&pdev->dev, "found %d slot(s)\n", slots);
> @@ -2211,7 +2214,7 @@ static int sdhci_pci_probe(struct pci_dev *pdev,
>  
>  	ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &first_bar);
>  	if (ret)
> -		return ret;
> +		return pcibios_err_to_errno(ret);
>  
>  	first_bar &= PCI_SLOT_INFO_FIRST_BAR_MASK;
>  


  parent reply	other threads:[~2024-06-03  7:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 13:24 [PATCH 1/2] mmc: sdhci-pci: Convert PCIBIOS_* return codes to errnos Ilpo Järvinen
2024-05-27 13:24 ` [PATCH 2/2] mmc: sdhci-pci-o2micro: " Ilpo Järvinen
2024-06-03  7:16   ` Adrian Hunter
2024-06-04 11:13   ` Ulf Hansson
2024-06-03  7:16 ` Adrian Hunter [this message]
2024-06-04 11:13 ` [PATCH 1/2] mmc: sdhci-pci: " Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f0b04a9-449b-423a-8f74-e6d2e463d6bb@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=drzeus@drzeus.cx \
    --cc=fengguang.wu@intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox