Re: [PATCH 1/1] gpio: mxc: use platform_get_irq_optional() to avoid error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 8, 2023 at 10:46 PM Shenwei Wang <shenwei.wang@xxxxxxx> wrote:
>
> From: Fugang Duan <fugang.duan@xxxxxxx>
>
> Use platform_get_irq_optional() to avoid error message for the

an error

> optional irq.

...

>         if (irq_count > 1) {
> -               port->irq_high = platform_get_irq(pdev, 1);
> +               port->irq_high = platform_get_irq_optional(pdev, 1);
>                 if (port->irq_high < 0)
>                         port->irq_high = 0;

I would rather do

  err = platform_get_irq_optional(pdev, 1);
  if (err >= 0)
    port->irq_high = err;

>         }

And looking into the code the above piece makes more sense after
asking for the first (mandatory) IRQ.

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux