[PATCH] drivers: pci: controller: pcie-rockchip: Use dev_err_probe()

shao.mingyin@zte.com.cn posted 1 patch 10 months, 1 week ago
drivers/pci/controller/pcie-rockchip.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
[PATCH] drivers: pci: controller: pcie-rockchip: Use dev_err_probe()
Posted by shao.mingyin@zte.com.cn 10 months, 1 week ago
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
Re: [PATCH] drivers: pci: controller: pcie-rockchip: Use dev_err_probe()
Posted by Krzysztof Kozlowski 10 months, 1 week ago
On 03/04/2025 09:43, shao.mingyin@zte.com.cn wrote:
> 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>
> ---
Considering zte is sending untested patches from poor automation (or AI
generated), this might be correct or might not be because it does not
look like probe path.

Anyway, don't send patch by patch and line by line. Why you did not
decide to fix all of the places in these drivers?

NAK

Best regards,
Krzysztof
Re: [PATCH] drivers: pci: controller: pcie-rockchip: Use dev_err_probe()
Posted by Manivannan Sadhasivam 10 months, 1 week ago
On Fri, Apr 04, 2025 at 08:09:40AM +0200, Krzysztof Kozlowski wrote:
> On 03/04/2025 09:43, shao.mingyin@zte.com.cn wrote:
> > 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>
> > ---
> Considering zte is sending untested patches from poor automation (or AI
> generated), this might be correct or might not be because it does not
> look like probe path.
> 
> Anyway, don't send patch by patch and line by line. Why you did not
> decide to fix all of the places in these drivers?
> 

To bump up the contribution maybe :P

But to reiterate what Krzysztof said, please send patches only after fixing all
identical issues in the driver. Patches should be split only when the fixes are
non-identical.

- Mani

-- 
மணிவண்ணன் சதாசிவம்