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]

 




> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Sent: Tuesday, May 9, 2023 4:12 AM
> To: Shenwei Wang <shenwei.wang@xxxxxxx>
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>; Bartosz Golaszewski
> <brgl@xxxxxxxx>; Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>; Stephen
> Boyd <swboyd@xxxxxxxxxxxx>; Rafael J. Wysocki
> <rafael.j.wysocki@xxxxxxxxx>; linux-gpio@xxxxxxxxxxxxxxx; imx@xxxxxxxxxxxxxxx;
> dl-linux-imx <linux-imx@xxxxxxx>; Fugang Duan <fugang.duan@xxxxxxx>
> Subject: [EXT] Re: [PATCH 1/1] gpio: mxc: use platform_get_irq_optional() to
> avoid error message
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> 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)

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

Regards,
Shenwei

>     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