Re: [PATCH] soc: qcom: llcc-qcom: Handle errors from optional IRQ lookup

From: Konrad Dybcio

Date: Tue Aug 18 2026 - 05:23:20 EST


On 8/10/26 7:10 AM, phucduc.bui@xxxxxxxxx wrote:
> From: bui duc phuc <phucduc.bui@xxxxxxxxx>
>
> platform_get_irq_optional() can return errors such as -EPROBE_DEFER,
> but the driver currently stores the return value directly in
> drv_data->ecc_irq and continues probing.
>
> Propagate negative errors other than -ENXIO using dev_err_probe(), and
> only assign the IRQ to drv_data->ecc_irq when a valid IRQ number is
> returned.
>
> Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
> ---
> drivers/soc/qcom/llcc-qcom.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index 8948b5fd42d2..e42946810b50 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c
> @@ -5587,7 +5587,12 @@ static int qcom_llcc_probe(struct platform_device *pdev)
> goto err;
> }
>
> - drv_data->ecc_irq = platform_get_irq_optional(pdev, 0);
> + ret = platform_get_irq_optional(pdev, 0);
> + if (ret < 0 && ret != -ENXIO)
> + return dev_err_probe(&pdev->dev, ret, "failed to get IRQ resource\n");
> + if (ret > 0)
> + drv_data->ecc_irq = ret;

Techinically you can drop the second if-statement

Konrad