[PATCH 1/1] pci: add return value check to devm_add_action_or_reset
Conor Dooley
conor.dooley at microchip.com
Mon Jul 17 02:37:57 PDT 2023
Hey,
> $subject: pci: add return value check to devm_add_action_or_reset
Typically patches for this driver have used the prefix "PCI:
microchip:". Also, please put the () at the end of functions in commit
messages.
On Sun, Jul 16, 2023 at 08:48:35PM +0800, Yuanjun Gong wrote:
> devm_add_action_or_reset() may fail, therefore, a check to the
> return value of devm_add_action_or_reset() is added before return.
>
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun at 163.com>
> ---
> drivers/pci/controller/pcie-microchip-host.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c
> index 5e710e485464..8c77284fdc84 100644
> --- a/drivers/pci/controller/pcie-microchip-host.c
> +++ b/drivers/pci/controller/pcie-microchip-host.c
> @@ -863,8 +863,10 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
> if (ret)
> return ERR_PTR(ret);
>
> - devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
> + ret = devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
> clk);
Did checkpatch not complain about the alignment here?
With those fixed,
Reviewed-by: Conor Dooley <conor.dooley at microchip.com>
Thanks,
Conor.
> + if (ret)
> + return ERR_PTR(ret);
>
> return clk;
> }
> --
> 2.17.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20230717/c0ed3ac1/attachment.sig>
More information about the linux-riscv
mailing list