From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <5A42F154.1080002@rock-chips.com> Date: Wed, 27 Dec 2017 09:03:16 +0800 From: JeffyChen MIME-Version: 1.0 Subject: Re: [RFC PATCH v12 2/5] of/irq: Adjust of_pci_irq parsing for multiple interrupts References: <20171226023646.17722-1-jeffy.chen@rock-chips.com> <20171226023646.17722-3-jeffy.chen@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Rob Herring Cc: "linux-kernel@vger.kernel.org" , Bjorn Helgaas , linux-pm@vger.kernel.org, Tony Lindgren , Shawn Lin , Brian Norris , "Rafael J. Wysocki" , Doug Anderson , Frank Rowand , open@263.net, list@263.net, OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS List-ID: 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 :) > >