[PATCH v2 1/1] PCI: microchip: add return value check to devm_add_action_or_reset()

Conor Dooley conor at kernel.org
Tue Jul 18 03:50:15 PDT 2023


Hey,

On Mon, Jul 17, 2023 at 10:44:51PM +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>

I thought I gave a reviewed-by on the v1, so here you go again:
Reviewed-by: Conor Dooley <conor.dooley at microchip.com>

Thanks,
Conor.

> ---
>  drivers/pci/controller/pcie-microchip-host.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c
> index 5e710e485464..dd0215dbda77 100644
> --- a/drivers/pci/controller/pcie-microchip-host.c
> +++ b/drivers/pci/controller/pcie-microchip-host.c
> @@ -863,8 +863,9 @@ 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,
> -				 clk);
> +	ret = devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare, clk);
> +	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/20230718/e6834e3c/attachment.sig>


More information about the linux-riscv mailing list