devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: JeffyChen <jeffy.chen@rock-chips.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-pm@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Brian Norris <briannorris@chromium.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Doug Anderson <dianders@chromium.org>,
	Frank Rowand <frowand.list@gmail.com>,
	open@263.net, list@263.net,
	OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
	<devicetree@vger.kernel.org>
Subject: Re: [RFC PATCH v12 2/5] of/irq: Adjust of_pci_irq parsing for multiple interrupts
Date: Wed, 27 Dec 2017 09:03:16 +0800	[thread overview]
Message-ID: <5A42F154.1080002@rock-chips.com> (raw)
In-Reply-To: <CAL_JsqL8nztgA0RWw5f_H75T4iVEDt23poUXb_RsL+jWmQ-X6w@mail.gmail.com>

Hi Rob,

Thanks for your reply :)

On 12/26/2017 11:48 PM, Rob Herring wrote:
>> >+               /*
>> >+                * Only parse from DT if we have no "interrupt-names",
>> >+                * or if we found an interrupt named "pci".
>> >+                */
>> >+               if (index == 0 || name) {
>> >+                       rc = of_irq_parse_one(dn, index, out_irq);
>> >+                       if (!rc)
>> >+                               return rc;
>> >+               }
> As mentioned before, use of_property_match_string. The following should work:
>
> index = of_property_match_string(dn, "interrupt-names", "pci");
> if (index == -EINVAL)  /* Property doesn't exist */
>    index = 0;
>
> if (index >= 0) {
>    rc = of_irq_parse_one(dn, index, out_irq);
>    if (!rc)
>      return rc;
> }

hmmm, right, that should work. didn't notice of_property_match_string() 
would return different error numbers for string not found and property 
doesn't exist...

will do this in the next version, thanks :)

>
>

  reply	other threads:[~2017-12-27  1:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26  2:36 [RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core Jeffy Chen
2017-12-26  2:36 ` [RFC PATCH v12 1/5] dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq Jeffy Chen
2017-12-26 23:35   ` Rob Herring
2017-12-27  0:43     ` Rafael J. Wysocki
2017-12-27  1:36       ` JeffyChen
2017-12-26  2:36 ` [RFC PATCH v12 5/5] arm64: dts: rockchip: Move PCIe WAKE# irq to pcie port for Gru Jeffy Chen
     [not found]   ` <20171226023646.17722-6-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-12-29 17:55     ` Tony Lindgren
2017-12-30  0:10       ` Rafael J. Wysocki
     [not found] ` <20171226023646.17722-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-12-26  2:36   ` [RFC PATCH v12 2/5] of/irq: Adjust of_pci_irq parsing for multiple interrupts Jeffy Chen
2017-12-26 15:48     ` Rob Herring
2017-12-27  1:03       ` JeffyChen [this message]
2017-12-26  2:36   ` [RFC PATCH v12 4/5] PCI / PM: Add support for the PCIe WAKE# signal for OF Jeffy Chen
     [not found]     ` <20171226023646.17722-5-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-12-26 23:56       ` Rob Herring
2017-12-27  1:32         ` JeffyChen
     [not found]           ` <5A42F847.5060305-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-12-27 15:30             ` Rob Herring
     [not found]               ` <CAL_JsqJssPABjoRM-XAnuN_Xd2-sHoFifJNrRDdk_ruQ0DRw6A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-28  0:32                 ` Rafael J. Wysocki
2017-12-28  8:47                 ` Andy Shevchenko
2017-12-27  0:44   ` [RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2017-12-26  2:08 Jeffy Chen
     [not found] ` <20171226020806.32710-1-jeffy.chen-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-12-26  2:08   ` [RFC PATCH v12 2/5] of/irq: Adjust of_pci_irq parsing for multiple interrupts Jeffy Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A42F154.1080002@rock-chips.com \
    --to=jeffy.chen@rock-chips.com \
    --cc=bhelgaas@google.com \
    --cc=briannorris@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=list@263.net \
    --cc=open@263.net \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).