lkml.org 
[lkml]   [2017]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v8 4/7] of/irq: Adjust of pci irq parsing for multiple interrupts
On Mon, Oct 30, 2017 at 10:05:51AM +0800, Jeffy Chen wrote:
> On 10/27/2017 10:38 PM, Rob Herring wrote:
> >>+ prop = of_find_property(dn, "interrupt-names", NULL);
> >>>+ for (name = of_prop_next_string(prop, NULL); name;
> >>>+ name = of_prop_next_string(prop, name), index++) {
> >>>+ if (!strcmp(name, "pci"))
> >>>+ break;
> >Use of_property_match_string
> >
> i'm trying to find the first unnamed or "pci" named irq in the
> string array, so cannot use that API:)

Actually, why can't you? It does exactly what your loop does right now.
You'd just need to handle the -ENODATA case better. e.g., check if we
have an interrupt-names property -- if not, just take index 0; if so,
then use of_property_match_string().

Brian

> but will change to of_property_for_each_string as Brian suggested.
>

\
 
 \ /
  Last update: 2017-10-30 19:48    [W:0.130 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site