All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] pci: layerscape: Adjust the return value when ls_pcie_addr_valid() fails
Date: Fri,  8 Jan 2016 01:03:21 -0800	[thread overview]
Message-ID: <1452243801-19479-2-git-send-email-bmeng.cn@gmail.com> (raw)
In-Reply-To: <1452243801-19479-1-git-send-email-bmeng.cn@gmail.com>

When trying to access non-existent/unsupported PCI devices in
ls_pcie_read_config(), when ls_pcie_addr_valid() fails it returns
error code and fills in the result with 0xffffffff manually. But it
really should return zero to upper layer codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 drivers/pci/pcie_layerscape.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c
index 58e88ae..99f9c83 100644
--- a/drivers/pci/pcie_layerscape.c
+++ b/drivers/pci/pcie_layerscape.c
@@ -314,7 +314,7 @@ static int ls_pcie_read_config(struct pci_controller *hose, pci_dev_t d,
 
 	if (ls_pcie_addr_valid(hose, d)) {
 		*val = 0xffffffff;
-		return -EINVAL;
+		return 0;
 	}
 
 	if (PCI_BUS(d) == hose->first_busno) {
-- 
1.7.9.5

  reply	other threads:[~2016-01-08  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  9:03 [U-Boot] [PATCH 1/2] pci: imx: Adjust the return value when imx_pcie_addr_valid() fails Bin Meng
2016-01-08  9:03 ` Bin Meng [this message]
2016-01-09  3:35   ` [U-Boot] [U-Boot, 2/2] pci: layerscape: Adjust the return value when ls_pcie_addr_valid() fails Tom Rini
2016-01-09  3:35 ` [U-Boot] [U-Boot, 1/2] pci: imx: Adjust the return value when imx_pcie_addr_valid() fails Tom Rini

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=1452243801-19479-2-git-send-email-bmeng.cn@gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.