linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] PCI/pwrctrl: Propagate dev_err_probe return value
@ 2025-10-18  7:02 Anand Moon
  2025-10-18  7:31 ` Christophe JAILLET
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Anand Moon @ 2025-10-18  7:02 UTC (permalink / raw)
  To: Bartosz Golaszewski, Bjorn Helgaas, open list:PCI POWER CONTROL,
	open list
  Cc: Anand Moon

Ensure that the return value from dev_err_probe() is consistently assigned
back to return in all error paths within pci_pwrctrl_slot_probe()
function. This ensures the original error code are propagation for
debugging.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/pci/pwrctrl/slot.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pwrctrl/slot.c b/drivers/pci/pwrctrl/slot.c
index 3320494b62d89..36a6282fd222d 100644
--- a/drivers/pci/pwrctrl/slot.c
+++ b/drivers/pci/pwrctrl/slot.c
@@ -41,14 +41,13 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
 	ret = of_regulator_bulk_get_all(dev, dev_of_node(dev),
 					&slot->supplies);
 	if (ret < 0) {
-		dev_err_probe(dev, ret, "Failed to get slot regulators\n");
-		return ret;
+		return dev_err_probe(dev, ret, "Failed to get slot regulators\n");
 	}
 
 	slot->num_supplies = ret;
 	ret = regulator_bulk_enable(slot->num_supplies, slot->supplies);
 	if (ret < 0) {
-		dev_err_probe(dev, ret, "Failed to enable slot regulators\n");
+		ret = dev_err_probe(dev, ret, "Failed to enable slot regulators\n");
 		regulator_bulk_free(slot->num_supplies, slot->supplies);
 		return ret;
 	}

base-commit: f406055cb18c6e299c4a783fc1effeb16be41803
-- 
2.50.1


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

end of thread, other threads:[~2025-10-31  8:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-18  7:02 [PATCH v1] PCI/pwrctrl: Propagate dev_err_probe return value Anand Moon
2025-10-18  7:31 ` Christophe JAILLET
2025-10-18 16:05   ` [PATCH] " Markus Elfring
2025-10-19  8:16     ` Anand Moon
2025-10-19  8:56       ` Markus Elfring
2025-10-19 10:19         ` Anand Moon
2025-10-18 15:13 ` [PATCH] " Markus Elfring
2025-10-31  8:28 ` [PATCH v1] " Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).