All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: songxiaowei@hisilicon.com, wangbinghui@hisilicon.com,
	lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com,
	bhelgaas@google.com, ffclaire1224@gmail.com,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: beanhuo@micron.com
Subject: [PATCH] PCI: kirin: Fix kirin960-pcie probe failure issue
Date: Tue,  1 Feb 2022 22:59:41 +0100	[thread overview]
Message-ID: <20220201215941.1203155-1-huobean@gmail.com> (raw)

From: Bean Huo <beanhuo@micron.com>

of_device_get_match_data() will return 'enum pcie_kirin_phy_type' type
value, and most likely the return value will be PCIE_KIRIN_INTERNAL_PHY == 0.
This will cause the PCI probe to fail. And of_device_get_match_data() does not
require error checking on its return on devicetree based platform.

So,this patch is to remove unnecessary error checking to fix kirin960-pcie
probe failure issue.

Fixes: a622435fbe1a ("PCI: kirin: Prefer of_device_get_match_data()")
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/pci/controller/dwc/pcie-kirin.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
index fa6886d66488..e102aa6efb7f 100644
--- a/drivers/pci/controller/dwc/pcie-kirin.c
+++ b/drivers/pci/controller/dwc/pcie-kirin.c
@@ -781,12 +781,7 @@ static int kirin_pcie_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	phy_type = (long)of_device_get_match_data(dev);
-	if (!phy_type) {
-		dev_err(dev, "OF data missing\n");
-		return -EINVAL;
-	}
-
+	phy_type = (enum pcie_kirin_phy_type)of_device_get_match_data(dev);
 
 	kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL);
 	if (!kirin_pcie)
-- 
2.25.1


             reply	other threads:[~2022-02-01 21:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 21:59 Bean Huo [this message]
2022-02-02  4:00 ` [PATCH] PCI: kirin: Fix kirin960-pcie probe failure issue kernel test robot
2022-02-02  4:00   ` kernel test robot
2022-02-02 16:26 ` Bjorn Helgaas
2022-02-02 16:36   ` Bjorn Helgaas
2022-02-02 17:18   ` Bean Huo
2022-02-02 21:40   ` Bjorn Helgaas

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=20220201215941.1203155-1-huobean@gmail.com \
    --to=huobean@gmail.com \
    --cc=beanhuo@micron.com \
    --cc=bhelgaas@google.com \
    --cc=ffclaire1224@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh@kernel.org \
    --cc=songxiaowei@hisilicon.com \
    --cc=wangbinghui@hisilicon.com \
    /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.