Re: [PATCH] cpufreq: qcom-hw: Use optional irq API

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

 



On Mon, Dec 6, 2021 at 5:26 PM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> On 16-11-21, 18:03, Stephen Boyd wrote:
> > Use platform_get_irq_optional() to avoid a noisy error message when the
> > irq isn't specified. The irq is definitely optional given that we only
> > care about errors that are -EPROBE_DEFER here.

> > +     data->throttle_irq = platform_get_irq_optional(pdev, index);
> > +     if (data->throttle_irq == -ENXIO)
> > +             return 0;
> > +     if (data->throttle_irq < 0)
> > +             return data->throttle_irq;

This adds more work for the future.
The best approach is

ret = platform_get_irq_optional(...);
if (ret < 0 && ret != -ENXIO)
  return ret;
if (ret > 0)
  ...we got it...

It will allow the future API fix of platform_get_irq_optional() to be
really optional.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux