Re: [EXT] 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 Tue, May 9, 2023 at 6:31 PM Shenwei Wang <shenwei.wang@xxxxxxx> wrote:
> > From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> > Sent: Tuesday, May 9, 2023 4:12 AM
> > On Mon, May 8, 2023 at 10:46 PM Shenwei Wang <shenwei.wang@xxxxxxx>
> > wrote:

...

> > >         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)
>
> Should be "if (err > 0)", right? As the platform_get_irq_optional() return non-zero
> IRQ number on success.

Either way will work, but your proposal is better.

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