Re: [PATCH] PCI: starfive: Propagate dev_err_probe return value

From: Markus Elfring
Date: Sat Oct 18 2025 - 04:24:55 EST


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

I find the change description improvable.


I propose to take another source code transformation approach better into account.
https://elixir.bootlin.com/linux/v6.17.1/source/drivers/base/core.c#L5031-L5075

Example:
https://elixir.bootlin.com/linux/v6.17.1/source/drivers/pci/controller/plda/pcie-starfive.c#L171-L187

ret = dev_err_probe(dev, reset_control_deassert(pcie->resets),
"failed to deassert resets\n");
if (ret)
clk_bulk_disable_unprepare(pcie->num_clks, pcie->clks);


How do you think about to achieve such a source code variant also with the help of
the semantic patch language (Coccinelle software)?

Regards,
Markus