[PATCH] PCI: j721e: Properly check the error of a syscon lookup

Garg, Aksh a-garg7 at ti.com
Fri Nov 27 02:36:17 PST 2026


On 27/11/26 15:49, Anton Protopopov wrote:
> The syscon_regmap_lookup_by_phandle_optional() function returns NULL
> only when the property is missing (-ENODEV). On other errors it returns
> an error pointer. The j721e_pcie_ctrl_init() function checks only for
> NULL and passes an error pointer to j721e_enable_acspcie_refclk(),
> which uses it as a regmap. Propagate the error instead.
> 
> Fixes: 82c4be4168e2 ("PCI: j721e: Enable ACSPCIE Refclk if "ti,syscon-acspcie-proxy-ctrl" exists")
> Signed-off-by: Anton Protopopov <a.s.protopopov at gmail.com>
> ---

Reviewed-by: Aksh Garg <a-garg7 at ti.com>

Regards,
Aksh Garg

> 
> (Accidentally bumped into this while working on BPF stuff.)
> 
>   drivers/pci/controller/cadence/pci-j721e.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c
> index 822602836b12..fdae51e368e0 100644
> --- a/drivers/pci/controller/cadence/pci-j721e.c
> +++ b/drivers/pci/controller/cadence/pci-j721e.c
> @@ -334,6 +334,8 @@ static int j721e_pcie_ctrl_init(struct j721e_pcie *pcie)
>   						"ti,syscon-acspcie-proxy-ctrl");
>   	if (!syscon)
>   		return 0;
> +	if (IS_ERR(syscon))
> +		return PTR_ERR(syscon);
>   
>   	return j721e_enable_acspcie_refclk(pcie, syscon);
>   }



More information about the linux-arm-kernel mailing list