[PATCH v5 2/9] pci: pwrctrl: slot: fix dev_err_probe() usage

Neil Armstrong
2026-02-20T15:04:51Z

The code was not returning dev_err_probe() but dev_err_probe()
returns the error code, so simplify the code.

Suggested-by: Bartosz Golaszewski <brgl@kernel.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
drivers/pci/pwrctrl/slot.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pwrctrl/slot.c b/drivers/pci/pwrctrl/slot.c
index 082af81efe25..f03debabbc73 100644
--- a/drivers/pci/pwrctrl/slot.c
+++ b/drivers/pci/pwrctrl/slot.c
@@ -88,18 +88,15 @@ static int slot_pwrctrl_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;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to get slot regulators\n");

slot->num_supplies = ret;

slot->clk = devm_clk_get_optional(dev, NULL);
- if (IS_ERR(slot->clk)) {
+ if (IS_ERR(slot->clk))
return dev_err_probe(dev, PTR_ERR(slot->clk),
"Failed to enable slot clock\n");
- }

skip_resources:
slot->pwrctrl.power_on = slot_pwrctrl_power_on;

--
2.34.1