lkml.org 
[lkml]   [2021]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] cpufreq: qcom-hw: Use optional irq API
On Mon, Dec 6, 2021 at 5:26 PM Viresh Kumar <viresh.kumar@linaro.org> 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

\
 
 \ /
  Last update: 2021-12-25 17:38    [W:0.184 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site