All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: kirin: Fix kirin960-pcie probe failure issue
@ 2022-02-01 21:59 Bean Huo
  2022-02-02  4:00   ` kernel test robot
  2022-02-02 16:26 ` Bjorn Helgaas
  0 siblings, 2 replies; 7+ messages in thread
From: Bean Huo @ 2022-02-01 21:59 UTC (permalink / raw)
  To: songxiaowei, wangbinghui, lorenzo.pieralisi, robh, kw, bhelgaas,
	ffclaire1224, linux-pci, linux-kernel
  Cc: beanhuo

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-02 21:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 21:59 [PATCH] PCI: kirin: Fix kirin960-pcie probe failure issue Bean Huo
2022-02-02  4:00 ` 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

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.