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

Bui Duc Phuc <[email protected]>
Newsgroups org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel
Message-ID <CAABR9nGmyMNREPLbHjkRovDF84VipqxQJssN78b1tKCenSh+GA@mail.gmail.com>
Hi Konrad,

Thank you for your review.

> >
> > -     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
>

You are right. I checked the handling of ecc_irq here:

https://elixir.bootlin.com/linux/v7.2-rc7/source/drivers/edac/qcom_edac.c#L369

It already checks for > 0 before calling devm_request_irq().
So the second if statement can be removed entirely.
I will send v2 shortly.

Best regards,
Phuc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.