Re: [PATCH] PCI: xilinx-nwl: Enable the clock through CCF

From: Krzysztof Wilczyński
Date: Wed Jun 23 2021 - 08:20:45 EST


Hi Michal,

Thank you for sending the patch over!

> Simply enable clocks. There is no remove function that's why
> this should be enough for simple operation.

What clock is this? Would it be worth mentioning what it is for
a reference (and for posterity) the commit message?

Also why it would need to be enabled and wasn't before? Would this be
a fix for some problem? Would this warrant a "Fixes:" tag? And would
it need to be back-ported to stable kernels?

[...]
> @@ -823,6 +825,11 @@ static int nwl_pcie_probe(struct platform_device *pdev)
> return err;
> }
>
> + pcie->clk = devm_clk_get(dev, NULL);
> + if (IS_ERR(pcie->clk))
> + return PTR_ERR(pcie->clk);
> + clk_prepare_enable(pcie->clk);
> +
[...]

Almost every other user of clk_prepare_enable() would check for
potential failure, print an appropriate message, and then do the
necessary clean-up before bailing out and returning an error.

Would adding an error check for clk_prepare_enable() and printing an
error message using dev_err() be too much in this case? If not, then
I would rather follow the pattern that other users established and
handle errors as needed. What do you think?

Krzysztof