mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drivers: pci: controller: pcie-rockchip: Use dev_err_probe()
@ 2025-04-03  7:43 shao.mingyin
  2025-04-04  6:09 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: shao.mingyin @ 2025-04-03  7:43 UTC (permalink / raw)
  To: shawn.lin
  Cc: yang.yang29, xu.xin16, ye.xingchen, lpieralisi, kw,
	manivannan.sadhasivam, robh, bhelgaas, heiko, linux-pci,
	linux-rockchip, linux-arm-kernel, linux-kernel, zhang.enpei

From: Zhang Enpei <zhang.enpei@zte.com.cn>

Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/pci/controller/pcie-rockchip.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c
index 0f88da378805..9897824a81f8 100644
--- a/drivers/pci/controller/pcie-rockchip.c
+++ b/drivers/pci/controller/pcie-rockchip.c
@@ -230,12 +230,9 @@ int rockchip_pcie_get_phys(struct rockchip_pcie *rockchip)
 		phy = devm_of_phy_get(dev, dev->of_node, name);
 		kfree(name);

-		if (IS_ERR(phy)) {
-			if (PTR_ERR(phy) != -EPROBE_DEFER)
-				dev_err(dev, "missing phy for lane %d: %ld\n",
-					i, PTR_ERR(phy));
-			return PTR_ERR(phy);
-		}
+		if (IS_ERR(phy))
+			return dev_err_probe(dev, PTR_ERR(phy),
+					     "missing phy for lane %d\n", i);

 		rockchip->phys[i] = phy;
 	}
-- 
2.25.1

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

end of thread, other threads:[~2025-04-04 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-03  7:43 [PATCH] drivers: pci: controller: pcie-rockchip: Use dev_err_probe() shao.mingyin
2025-04-04  6:09 ` Krzysztof Kozlowski
2025-04-04 12:52   ` Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®