Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756225AbaGETFG (ORCPT ); Sat, 5 Jul 2014 15:05:06 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]:56994 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755414AbaGETFE (ORCPT ); Sat, 5 Jul 2014 15:05:04 -0400 MIME-Version: 1.0 In-Reply-To: <20140702111748.GJ18731@arm.com> References: <1404240214-9804-1-git-send-email-Liviu.Dudau@arm.com> <1404240214-9804-8-git-send-email-Liviu.Dudau@arm.com> <20140702111748.GJ18731@arm.com> From: Rob Herring Date: Sat, 5 Jul 2014 14:04:41 -0500 Message-ID: Subject: Re: [PATCH v8 7/9] pci: of: Parse and map the IRQ when adding the PCI device. To: Will Deacon Cc: Liviu Dudau , Sinan Kaya , linaro-kernel , Catalin Marinas , Device Tree ML , linux-pci , Jingoo Han , LKML , Kukjin Kim , Tanmay Inamdar , Suravee Suthikulanit , Benjamin Herrenschmidt , Bjorn Helgaas , LAKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 2, 2014 at 6:17 AM, Will Deacon wrote: > On Tue, Jul 01, 2014 at 07:43:32PM +0100, Liviu Dudau wrote: >> Enhance the default implementation of pcibios_add_device() to >> parse and map the IRQ of the device if a DT binding is available. >> >> Signed-off-by: Liviu Dudau >> --- >> drivers/pci/pci.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c >> index 63a54a3..8e65dc3 100644 >> --- a/drivers/pci/pci.c >> +++ b/drivers/pci/pci.c >> @@ -17,6 +17,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -1453,6 +1454,9 @@ EXPORT_SYMBOL(pcim_pin_device); >> */ >> int __weak pcibios_add_device(struct pci_dev *dev) >> { >> +#ifdef CONFIG_OF >> + dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); >> +#endif > > You could avoid the #ifdef by only assigning dev->irq if > of_irq_parse_and_map_pci returned something > 0. Perhaps it could just be unconditional always. Presumably, dev->irq is not already set to something valid and setting it to <= 0 should not have any consequences. Rob -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/