lkml.org 
[lkml]   [2023]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 09/43] clocksource: ep93xx: Add driver for Cirrus Logic EP93xx
On Thu, Jun 29, 2023 at 4:10 PM Nikita Shubin <nikita.shubin@maquefel.me> wrote:
> On Wed, 2023-06-21 at 11:28 +0300, Andy Shevchenko wrote:
> > On Wed, Jun 21, 2023 at 11:22 AM Nikita Shubin
> > <nikita.shubin@maquefel.me> wrote:

...

> > > > > + irq = irq_of_parse_and_map(np, 0);
> > > > > + if (irq <= 0) {
> > > > > + pr_err("ERROR: invalid interrupt number\n");
> > > > > + ret = -EINVAL;
> > > >
> > > > Shadowed error in case of negative returned code. Why?
> > >
> > > Majority of clocksource drivers shadow it. Same like above.
> >
> > It doesn't mean they are correct or using brand new APIs.
>
> Or may be this because irq_of_parse_and_map can return zero as error,
> and returning zero from timer_init means success ?
>
> Please correct me if i am wrong here.

0 means no mapped IRQ.

> > Can you use fwnode_irq_get() instead?
>
> Will it help ?

Yes, definitely, in two aspects:
1/ it makes code less OF-dependent (helps also OF people to clean up
the spread of OF headers and APIs where they are not needed);
2/ it takes care about proper error codes.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2023-06-29 15:41    [W:0.229 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site