Skip to contentSkip to conversation

PCI: rockchip: Improve error handling in clock return value

PATCH In review Anand Moon 3 participants 4 messages Jan 6, 2025 – Jan 15, 2025

Subsystems (4)
lore
Share & tools
lore

Anand Moon

author
#0 lore raw

PATCH 1/1 PCI: rockchip: Improve error handling in clock return value

Updates the error message to include the actual return value of devm_clk_bulk_get_all, which provides more context for debugging and troubleshooting the root cause of clock retrieval failures.

---
 drivers/pci/controller/pcie-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-rockchip.c +2 -1
index fea867c24f75..ca6163f9d2dd 100644
@@ -99,7 +99,8 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
 
 	rockchip->num_clks = devm_clk_bulk_get_all(dev, &rockchip->clks);
 	if (rockchip->num_clks < 0)
-		return dev_err_probe(dev, err, "failed to get clocks\n");
+		return dev_err_probe(dev, rockchip->num_clks,
+				     "failed to get clocks\n");
 
 	return 0;
 }
Signature · 1 line
2.47.1
#1 lore raw

On Mon, Jan 06, 2025 at 09:00:38PM +0530, Anand Moon wrote:

Subject should include the word 'fix' not 'improve'

Quoted 1 line

Updates the error message to include the actual return value of

s/Updates/Update (imperative form)

Quoted 3 lines

devm_clk_bulk_get_all, which provides more context for debugging and troubleshooting the root cause of clock retrieval failures.

Btw, it is not just updating the error message, it also returns the actual error code.

- Mani

Quoted 24 lines
---
 drivers/pci/controller/pcie-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-rockchip.c +2 -1
index fea867c24f75..ca6163f9d2dd 100644
@@ -99,7 +99,8 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
 
 	rockchip->num_clks = devm_clk_bulk_get_all(dev, &rockchip->clks);
 	if (rockchip->num_clks < 0)
-		return dev_err_probe(dev, err, "failed to get clocks\n");
+		return dev_err_probe(dev, rockchip->num_clks,
+				     "failed to get clocks\n");
 
 	return 0;
 }
Signature · 1 line
2.47.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#2 lore raw
Quoted 6 lines · Manivannan Sadhasivam

On Mon, Jan 06, 2025 at 09:00:38PM +0530, Anand Moon wrote:

Subject should include the word 'fix' not 'improve'

Quoted 1 line

Updates the error message to include the actual return value of

Quoted 7 lines

s/Updates/Update (imperative form)

Quoted 2 lines

devm_clk_bulk_get_all, which provides more context for debugging and troubleshooting the root cause of clock retrieval failures.

Btw, it is not just updating the error message, it also returns the actual error code.

Already squashed into
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?id=abdd4c8ea7d7,
sorry I didn't mention that here.

Quoted 27 lines
Quoted 24 lines
---
 drivers/pci/controller/pcie-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-rockchip.c +2 -1
index fea867c24f75..ca6163f9d2dd 100644
@@ -99,7 +99,8 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
 
 	rockchip->num_clks = devm_clk_bulk_get_all(dev, &rockchip->clks);
 	if (rockchip->num_clks < 0)
-		return dev_err_probe(dev, err, "failed to get clocks\n");
+		return dev_err_probe(dev, rockchip->num_clks,
+				     "failed to get clocks\n");
 
 	return 0;
 }
Signature · 1 line
2.47.1
Signature · 1 line
மணிவண்ணன் சதாசிவம்
author
#3 lore raw

Hi Mani/ Bjon,

Quoted 8 lines · Bjorn Helgaas
Quoted 6 lines · Manivannan Sadhasivam

On Mon, Jan 06, 2025 at 09:00:38PM +0530, Anand Moon wrote:

Subject should include the word 'fix' not 'improve'

Quoted 1 line

Updates the error message to include the actual return value of

Quoted 7 lines
Quoted 7 lines

s/Updates/Update (imperative form)

Quoted 2 lines

devm_clk_bulk_get_all, which provides more context for debugging and troubleshooting the root cause of clock retrieval failures.

Btw, it is not just updating the error message, it also returns the actual error code.

correct.

Quoted 5 lines

Already squashed into
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?id=abdd4c8ea7d7,
sorry I didn't mention that here.

Thanks,

I will focus on improving my communication skills and delivering impactful commit messages in the future.

Thank
-Anand