From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de ([212.227.17.24]:49377 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755144AbaCNRGM (ORCPT ); Fri, 14 Mar 2014 13:06:12 -0400 From: Arnd Bergmann To: Liviu Dudau Subject: Re: [PATCH v7 2/6] pci: OF: Fix the conversion of IO ranges into IO resources. Date: Fri, 14 Mar 2014 18:05:28 +0100 Cc: "linux-pci" , Bjorn Helgaas , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , "linaro-kernel" , LKML , "devicetree@vger.kernel.org" , LAKML , Tanmay Inamdar , Grant Likely References: <1394811272-1547-1-git-send-email-Liviu.Dudau@arm.com> <1394811272-1547-3-git-send-email-Liviu.Dudau@arm.com> In-Reply-To: <1394811272-1547-3-git-send-email-Liviu.Dudau@arm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Message-Id: <201403141805.29204.arnd@arndb.de> Sender: linux-pci-owner@vger.kernel.org List-ID: On Friday 14 March 2014, Liviu Dudau wrote: > +int of_pci_range_to_resource(struct of_pci_range *range, > + struct device_node *np, struct resource *res) > +{ > + res->flags = range->flags; > + if (res->flags & IORESOURCE_IO) { > + unsigned long port = -1; > + int err = pci_register_io_range(range->cpu_addr, range->size); > + if (err) > + return err; > + port = pci_address_to_pio(range->cpu_addr); > + if (port == (unsigned long)-1) { > + res->start = (resource_size_t)OF_BAD_ADDR; > + res->end = (resource_size_t)OF_BAD_ADDR; > + return -EINVAL; > + } The error handling is inconsistent here: in one case you set the resource to OF_BAD_ADDR, in the other one you don't. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: arnd@arndb.de (Arnd Bergmann) Date: Fri, 14 Mar 2014 18:05:28 +0100 Subject: [PATCH v7 2/6] pci: OF: Fix the conversion of IO ranges into IO resources. In-Reply-To: <1394811272-1547-3-git-send-email-Liviu.Dudau@arm.com> References: <1394811272-1547-1-git-send-email-Liviu.Dudau@arm.com> <1394811272-1547-3-git-send-email-Liviu.Dudau@arm.com> Message-ID: <201403141805.29204.arnd@arndb.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Friday 14 March 2014, Liviu Dudau wrote: > +int of_pci_range_to_resource(struct of_pci_range *range, > + struct device_node *np, struct resource *res) > +{ > + res->flags = range->flags; > + if (res->flags & IORESOURCE_IO) { > + unsigned long port = -1; > + int err = pci_register_io_range(range->cpu_addr, range->size); > + if (err) > + return err; > + port = pci_address_to_pio(range->cpu_addr); > + if (port == (unsigned long)-1) { > + res->start = (resource_size_t)OF_BAD_ADDR; > + res->end = (resource_size_t)OF_BAD_ADDR; > + return -EINVAL; > + } The error handling is inconsistent here: in one case you set the resource to OF_BAD_ADDR, in the other one you don't. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v7 2/6] pci: OF: Fix the conversion of IO ranges into IO resources. Date: Fri, 14 Mar 2014 18:05:28 +0100 Message-ID: <201403141805.29204.arnd@arndb.de> References: <1394811272-1547-1-git-send-email-Liviu.Dudau@arm.com> <1394811272-1547-3-git-send-email-Liviu.Dudau@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1394811272-1547-3-git-send-email-Liviu.Dudau@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Liviu Dudau Cc: "devicetree@vger.kernel.org" , linaro-kernel , Catalin Marinas , linux-pci , Will Deacon , LKML , Grant Likely , Tanmay Inamdar , Benjamin Herrenschmidt , Bjorn Helgaas , LAKML List-Id: devicetree@vger.kernel.org On Friday 14 March 2014, Liviu Dudau wrote: > +int of_pci_range_to_resource(struct of_pci_range *range, > + struct device_node *np, struct resource *res) > +{ > + res->flags = range->flags; > + if (res->flags & IORESOURCE_IO) { > + unsigned long port = -1; > + int err = pci_register_io_range(range->cpu_addr, range->size); > + if (err) > + return err; > + port = pci_address_to_pio(range->cpu_addr); > + if (port == (unsigned long)-1) { > + res->start = (resource_size_t)OF_BAD_ADDR; > + res->end = (resource_size_t)OF_BAD_ADDR; > + return -EINVAL; > + } The error handling is inconsistent here: in one case you set the resource to OF_BAD_ADDR, in the other one you don't. Arnd